[D3DCOMPILER_43] Sync with Wine Staging 3.17. CORE-15127
[reactos.git] / dll / directx / wine / d3dcompiler_43 / compiler.c
index 29615c5..53d2a43 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "d3dcompiler_private.h"
+#define COBJMACROS
+#include "config.h"
+#include "wine/port.h"
+#include "wine/debug.h"
 #include "wine/unicode.h"
+
+#include "d3dcompiler_private.h"
 #include "wine/wpp.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3dcompiler);
@@ -466,8 +471,8 @@ HRESULT WINAPI D3DAssemble(const void *data, SIZE_T datasize, const char *filena
 {
     HRESULT hr;
 
-    TRACE("data %p, datasize %lu, filename %s, defines %p, include %p, sflags %#x,\n"
-            "shader %p, error_messages %p\n",
+    TRACE("data %p, datasize %lu, filename %s, defines %p, include %p, sflags %#x, "
+            "shader %p, error_messages %p.\n",
             data, datasize, debugstr_a(filename), defines, include, flags, shader, error_messages);
 
     EnterCriticalSection(&wpp_mutex);
@@ -565,7 +570,7 @@ static const struct target_info targets_info[] = {
 static const struct target_info * get_target_info(const char *target)
 {
     LONG min = 0;
-    LONG max = sizeof(targets_info) / sizeof(targets_info[0]) - 1;
+    LONG max = ARRAY_SIZE(targets_info) - 1;
     LONG cur;
     int res;
 
@@ -687,16 +692,23 @@ static HRESULT compile_shader(const char *preproc_shader, const char *target, co
     return S_OK;
 }
 
-HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename,
+HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename,
         const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
-        const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
+        const char *target, UINT sflags, UINT eflags, UINT secondary_flags,
+        const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader,
+        ID3DBlob **error_messages)
 {
     HRESULT hr;
 
-    TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s,\n"
-            "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p\n",
+    TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, "
+            "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p, "
+            "secondary_data_size %lu, shader %p, error_messages %p.\n",
             data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint),
-            debugstr_a(target), sflags, eflags, shader, error_messages);
+            debugstr_a(target), sflags, eflags, secondary_flags, secondary_data,
+            secondary_data_size, shader, error_messages);
+
+    if (secondary_data)
+        FIXME("secondary data not implemented yet\n");
 
     if (shader) *shader = NULL;
     if (error_messages) *error_messages = NULL;
@@ -712,6 +724,19 @@ HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filena
     return hr;
 }
 
+HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename,
+        const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
+        const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
+{
+    TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, "
+            "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p.\n",
+            data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint),
+            debugstr_a(target), sflags, eflags, shader, error_messages);
+
+    return D3DCompile2(data, data_size, filename, defines, include, entrypoint, target, sflags,
+            eflags, 0, NULL, 0, shader, error_messages);
+}
+
 HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename,
         const D3D_SHADER_MACRO *defines, ID3DInclude *include,
         ID3DBlob **shader, ID3DBlob **error_messages)
@@ -758,3 +783,20 @@ HRESULT WINAPI D3DDisassemble(const void *data, SIZE_T size, UINT flags, const c
             data, size, flags, comments, disassembly);
     return E_NOTIMPL;
 }
+
+HRESULT WINAPI D3DCompileFromFile(const WCHAR *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *includes,
+        const char *entrypoint, const char *target, UINT flags1, UINT flags2, ID3DBlob **code, ID3DBlob **errors)
+{
+    FIXME("filename %s, defines %p, includes %p, entrypoint %s, target %s, flags1 %x, flags2 %x, code %p, errors %p\n",
+            debugstr_w(filename), defines, includes, debugstr_a(entrypoint), debugstr_a(target), flags1, flags2, code, errors);
+
+    return E_NOTIMPL;
+}
+
+#ifndef __REACTOS__
+HRESULT WINAPI D3DLoadModule(const void *data, SIZE_T size, ID3D11Module **module)
+{
+    FIXME("data %p, size %lu, module %p stub!\n", data, size, module);
+    return E_NOTIMPL;
+}
+#endif