[D3DCOMPILER_43] Sync with Wine Staging 1.7.55. CORE-10536
authorAmine Khaldi <amine.khaldi@reactos.org>
Sun, 22 Nov 2015 16:34:38 +0000 (16:34 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 22 Nov 2015 16:34:38 +0000 (16:34 +0000)
svn path=/trunk/; revision=70035

reactos/dll/directx/wine/d3dcompiler_43/CMakeLists.txt
reactos/dll/directx/wine/d3dcompiler_43/blob.c
reactos/dll/directx/wine/d3dcompiler_43/bytecodewriter.c
reactos/dll/directx/wine/d3dcompiler_43/compiler.c
reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h
reactos/dll/directx/wine/d3dcompiler_43/main.c [moved from reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_43_main.c with 100% similarity]
reactos/media/doc/README.WINE

index 7578f2f..aa8f6b1 100644 (file)
@@ -13,9 +13,9 @@ list(APPEND SOURCE
     blob.c
     bytecodewriter.c
     compiler.c
-    d3dcompiler_43_main.c
     hlsl.tab.c
     hlsl.yy.c
+    main.c
     reflection.c
     utils.c
     d3dcompiler_private.h
index c04891a..896038a 100644 (file)
@@ -460,3 +460,17 @@ HRESULT WINAPI D3DStripShader(const void *data, SIZE_T data_size, UINT flags, ID
 
     return d3dcompiler_strip_shader(data, data_size, flags, blob);
 }
+
+HRESULT WINAPI D3DReadFileToBlob(const WCHAR *filename, ID3DBlob **contents)
+{
+    FIXME("filename %s, contents %p\n", debugstr_w(filename), contents);
+
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI D3DWriteBlobToFile(ID3DBlob* blob, const WCHAR *filename, BOOL overwrite)
+{
+    FIXME("blob %p, filename %s, overwrite %d\n", blob, debugstr_w(filename), overwrite);
+
+    return E_NOTIMPL;
+}
index 17ea050..2b36319 100644 (file)
@@ -598,7 +598,7 @@ static void write_declarations(struct bc_writer *This,
         put_dword(buffer, instr_dcl);
 
         /* Write the usage and index */
-        token = (1 << 31); /* Bit 31 of non-instruction opcodes is 1 */
+        token = (1u << 31); /* Bit 31 of non-instruction opcodes is 1 */
         token |= (decls[i].usage << D3DSP_DCL_USAGE_SHIFT) & D3DSP_DCL_USAGE_MASK;
         token |= (decls[i].usage_idx << D3DSP_DCL_USAGEINDEX_SHIFT) & D3DSP_DCL_USAGEINDEX_MASK;
         put_dword(buffer, token);
@@ -614,7 +614,7 @@ static void write_declarations(struct bc_writer *This,
 static void write_const(struct constant **consts, int num, DWORD opcode, DWORD reg_type, struct bytecode_buffer *buffer, BOOL len) {
     int i;
     DWORD instr_def = opcode;
-    const DWORD reg = (1<<31) | d3dsp_register( reg_type, 0 ) | D3DSP_WRITEMASK_ALL;
+    const DWORD reg = (1u << 31) | d3dsp_register( reg_type, 0 ) | D3DSP_WRITEMASK_ALL;
 
     if(len) {
         if(opcode == D3DSIO_DEFB)
@@ -885,7 +885,7 @@ static DWORD map_vs_output(struct bc_writer *This, DWORD regnum, DWORD mask, DWO
 static void vs_12_dstreg(struct bc_writer *This, const struct shader_reg *reg,
                          struct bytecode_buffer *buffer,
                          DWORD shift, DWORD mod) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
     DWORD has_wmask;
 
     if(reg->rel_reg) {
@@ -959,7 +959,7 @@ static void vs_12_dstreg(struct bc_writer *This, const struct shader_reg *reg,
 
 static void vs_1_x_srcreg(struct bc_writer *This, const struct shader_reg *reg,
                           struct bytecode_buffer *buffer) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
     DWORD has_swizzle;
     DWORD component;
 
@@ -1070,7 +1070,7 @@ static DWORD map_ps_input(struct bc_writer *This,
 
 static void ps_1_0123_srcreg(struct bc_writer *This, const struct shader_reg *reg,
                              struct bytecode_buffer *buffer) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
     if(reg->rel_reg) {
         WARN("Relative addressing not supported in <= ps_3_0\n");
         This->state = E_INVALIDARG;
@@ -1116,7 +1116,7 @@ static void ps_1_0123_srcreg(struct bc_writer *This, const struct shader_reg *re
 static void ps_1_0123_dstreg(struct bc_writer *This, const struct shader_reg *reg,
                              struct bytecode_buffer *buffer,
                              DWORD shift, DWORD mod) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
 
     if(reg->rel_reg) {
         WARN("Relative addressing not supported for destination registers\n");
@@ -1378,7 +1378,7 @@ static const struct bytecode_backend ps_1_0123_backend = {
 
 static void ps_1_4_srcreg(struct bc_writer *This, const struct shader_reg *reg,
                           struct bytecode_buffer *buffer) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
     if(reg->rel_reg) {
         WARN("Relative addressing not supported in <= ps_3_0\n");
         This->state = E_INVALIDARG;
@@ -1417,7 +1417,7 @@ static void ps_1_4_srcreg(struct bc_writer *This, const struct shader_reg *reg,
 static void ps_1_4_dstreg(struct bc_writer *This, const struct shader_reg *reg,
                           struct bytecode_buffer *buffer,
                           DWORD shift, DWORD mod) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
 
     if(reg->rel_reg) {
         WARN("Relative addressing not supported for destination registers\n");
@@ -1564,7 +1564,7 @@ static void vs_2_header(struct bc_writer *This,
 static void vs_2_srcreg(struct bc_writer *This,
                         const struct shader_reg *reg,
                         struct bytecode_buffer *buffer) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
     DWORD has_swizzle;
     DWORD component;
     DWORD d3d9reg;
@@ -1799,12 +1799,12 @@ static void write_samplers(const struct bwriter_shader *shader, struct bytecode_
     DWORD i;
     DWORD instr_dcl = D3DSIO_DCL | (2 << D3DSI_INSTLENGTH_SHIFT);
     DWORD token;
-    const DWORD reg = (1<<31) | d3dsp_register( D3DSPR_SAMPLER, 0 ) | D3DSP_WRITEMASK_ALL;
+    const DWORD reg = (1u << 31) | d3dsp_register( D3DSPR_SAMPLER, 0 ) | D3DSP_WRITEMASK_ALL;
 
     for(i = 0; i < shader->num_samplers; i++) {
         /* Write the DCL instruction */
         put_dword(buffer, instr_dcl);
-        token = (1<<31);
+        token = (1u << 31);
         /* Already shifted */
         token |= (d3d9_sampler(shader->samplers[i].type)) & D3DSP_TEXTURETYPE_MASK;
         put_dword(buffer, token);
@@ -1831,7 +1831,7 @@ static void ps_2_header(struct bc_writer *This, const struct bwriter_shader *sha
 static void ps_2_srcreg(struct bc_writer *This,
                         const struct shader_reg *reg,
                         struct bytecode_buffer *buffer) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
     DWORD d3d9reg;
     if(reg->rel_reg) {
         WARN("Relative addressing not supported in <= ps_3_0\n");
@@ -1886,7 +1886,7 @@ static void ps_2_0_dstreg(struct bc_writer *This,
                           const struct shader_reg *reg,
                           struct bytecode_buffer *buffer,
                           DWORD shift, DWORD mod) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
     DWORD d3d9reg;
 
     if(reg->rel_reg) {
@@ -2059,7 +2059,7 @@ static void sm_3_header(struct bc_writer *This, const struct bwriter_shader *sha
 static void sm_3_srcreg(struct bc_writer *This,
                         const struct shader_reg *reg,
                         struct bytecode_buffer *buffer) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
     DWORD d3d9reg;
 
     d3d9reg = d3d9_register(reg->type);
@@ -2098,7 +2098,7 @@ static void sm_3_dstreg(struct bc_writer *This,
                         const struct shader_reg *reg,
                         struct bytecode_buffer *buffer,
                         DWORD shift, DWORD mod) {
-    DWORD token = (1 << 31); /* Bit 31 of registers is 1 */
+    DWORD token = (1u << 31); /* Bit 31 of registers is 1 */
     DWORD d3d9reg;
 
     if(reg->rel_reg) {
index 29615c5..2f1821e 100644 (file)
@@ -687,16 +687,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",
+            "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p,\n"
+            "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 +719,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,\n"
+            "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 +778,12 @@ 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;
+}
index b0c9389..c7ed2e9 100644 (file)
@@ -535,8 +535,8 @@ enum bwritershader_param_srcmod_type
     BWRITERSPSM_NOT,
 };
 
-#define BWRITER_SM1_VS  0xfffe
-#define BWRITER_SM1_PS  0xffff
+#define BWRITER_SM1_VS  0xfffeu
+#define BWRITER_SM1_PS  0xffffu
 
 #define BWRITERPS_VERSION(major, minor) ((BWRITER_SM1_PS << 16) | ((major) << 8) | (minor))
 #define BWRITERVS_VERSION(major, minor) ((BWRITER_SM1_VS << 16) | ((major) << 8) | (minor))
index 9429aa8..d204ba9 100644 (file)
@@ -24,7 +24,7 @@ The following libraries are shared with Wine.
 reactos/dll/directx/wine/amstream       # Synced to WineStaging-1.7.55
 reactos/dll/directx/wine/d3d8           # Synced to WineStaging-1.7.55
 reactos/dll/directx/wine/d3d9           # Synced to WineStaging-1.7.55
-reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-1.7.47
+reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-1.7.55
 reactos/dll/directx/wine/d3drm          # Synced to WineStaging-1.7.47
 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-1.7.55
 reactos/dll/directx/wine/d3dxof         # Synced to WineStaging-1.7.47