From 4dd28abbe5bb646b874de8d36f9fdf6c4d5b12da Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 18:26:34 +0000 Subject: [PATCH] [D3DCOMPILER_43] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62815 --- .../directx/wine/d3dcompiler_43/asmparser.c | 9 ++-- .../wine/d3dcompiler_43/asmshader.tab.c | 4 +- .../wine/d3dcompiler_43/asmshader.tab.h | 4 +- .../directx/wine/d3dcompiler_43/asmshader.y | 4 +- .../wine/d3dcompiler_43/asmshader.yy.c | 2 +- .../directx/wine/d3dcompiler_43/compiler.c | 15 +++--- .../wine/d3dcompiler_43/d3dcompiler_43_main.c | 2 +- .../wine/d3dcompiler_43/d3dcompiler_private.h | 53 ++++++++++--------- .../dll/directx/wine/d3dcompiler_43/hlsl.yy.c | 2 +- .../directx/wine/d3dcompiler_43/reflection.c | 18 +++---- .../dll/directx/wine/d3dcompiler_43/utils.c | 6 +-- reactos/media/doc/README.WINE | 2 +- 12 files changed, 63 insertions(+), 58 deletions(-) diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmparser.c b/reactos/dll/directx/wine/d3dcompiler_43/asmparser.c index 12d5fc3fa1d..1e7d1072762 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmparser.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmparser.c @@ -497,11 +497,10 @@ static void asmparser_texreg2rgb(struct asm_parser *This, DWORD mod, DWORD shift * go through asmparser_instr). */ -static void asmparser_instr(struct asm_parser *This, DWORD opcode, - DWORD mod, DWORD shift, - BWRITER_COMPARISON_TYPE comp, - const struct shader_reg *dst, - const struct src_regs *srcs, int expectednsrcs) { +static void asmparser_instr(struct asm_parser *This, DWORD opcode, DWORD mod, DWORD shift, + enum bwriter_comparison_type comp, const struct shader_reg *dst, + const struct src_regs *srcs, int expectednsrcs) +{ struct instruction *instr; unsigned int i; BOOL firstreg = TRUE; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.c b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.c index c8d80d3ceef..9c8604b7969 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.c @@ -343,12 +343,12 @@ typedef union YYSTYPE DWORD mod; DWORD shift; } modshift; - BWRITER_COMPARISON_TYPE comptype; + enum bwriter_comparison_type comptype; struct { DWORD dclusage; unsigned int regnum; } declaration; - BWRITERSAMPLER_TEXTURE_TYPE samplertype; + enum bwritersampler_texture_type samplertype; struct rel_reg rel_reg; struct src_regs sregs; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.h b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.h index 04e200d4e05..145e94774bb 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.h +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.h @@ -233,12 +233,12 @@ typedef union YYSTYPE DWORD mod; DWORD shift; } modshift; - BWRITER_COMPARISON_TYPE comptype; + enum bwriter_comparison_type comptype; struct { DWORD dclusage; unsigned int regnum; } declaration; - BWRITERSAMPLER_TEXTURE_TYPE samplertype; + enum bwritersampler_texture_type samplertype; struct rel_reg rel_reg; struct src_regs sregs; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.y b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.y index 4109745a6a8..5948d57d5ed 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.y +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.y @@ -92,12 +92,12 @@ int asmshader_lex(void); DWORD mod; DWORD shift; } modshift; - BWRITER_COMPARISON_TYPE comptype; + enum bwriter_comparison_type comptype; struct { DWORD dclusage; unsigned int regnum; } declaration; - BWRITERSAMPLER_TEXTURE_TYPE samplertype; + enum bwritersampler_texture_type samplertype; struct rel_reg rel_reg; struct src_regs sregs; } diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c index 446779b3932..1b31cec460f 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c @@ -360,7 +360,7 @@ void asmshader_free (void * ); /* Begin user sect3 */ -#define asmshader_wrap() 1 +#define asmshader_wrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/compiler.c b/reactos/dll/directx/wine/d3dcompiler_43/compiler.c index c5f3bfead9a..9b2ec54d24b 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/compiler.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/compiler.c @@ -144,8 +144,10 @@ static char *wpp_lookup_mem(const char *filename, int type, const char *parent_n char *path; int i; + TRACE("Looking for include %s.\n", debugstr_a(filename)); + parent_include = NULL; - if(parent_name[0] != '\0') + if (strcmp(parent_name, initial_filename)) { for(i = 0; i < includes_size; i++) { @@ -157,7 +159,7 @@ static char *wpp_lookup_mem(const char *filename, int type, const char *parent_n } if(parent_include == NULL) { - ERR("Parent include file missing\n"); + ERR("Parent include %s missing.\n", debugstr_a(parent_name)); return NULL; } } @@ -173,6 +175,8 @@ static void *wpp_open_mem(const char *filename, int type) struct mem_file_desc *desc; HRESULT hr; + TRACE("Opening include %s.\n", debugstr_a(filename)); + if(!strcmp(filename, initial_filename)) { current_shader.pos = 0; @@ -184,11 +188,8 @@ static void *wpp_open_mem(const char *filename, int type) if(!desc) return NULL; - hr = ID3DInclude_Open(current_include, - type ? D3D_INCLUDE_LOCAL : D3D_INCLUDE_SYSTEM, - filename, parent_include, (LPCVOID *)&desc->buffer, - &desc->size); - if(FAILED(hr)) + if (FAILED(hr = ID3DInclude_Open(current_include, type ? D3D_INCLUDE_LOCAL : D3D_INCLUDE_SYSTEM, + filename, parent_include, (const void **)&desc->buffer, &desc->size))) { HeapFree(GetProcessHeap(), 0, desc); return NULL; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_43_main.c b/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_43_main.c index 983031d5d95..f67f3a63f49 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_43_main.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_43_main.c @@ -21,7 +21,7 @@ #include "d3dcompiler_private.h" -BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) +BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) { switch (reason) { diff --git a/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h b/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h index c5304899ab3..0e887d0c66a 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h +++ b/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h @@ -57,7 +57,8 @@ enum shader_type ST_PIXEL }; -typedef enum BWRITER_COMPARISON_TYPE { +enum bwriter_comparison_type +{ BWRITER_COMPARISON_NONE, BWRITER_COMPARISON_GT, BWRITER_COMPARISON_EQ, @@ -65,7 +66,7 @@ typedef enum BWRITER_COMPARISON_TYPE { BWRITER_COMPARISON_LT, BWRITER_COMPARISON_NE, BWRITER_COMPARISON_LE -} BWRITER_COMPARISON_TYPE; +}; struct constant { DWORD regnum; @@ -92,7 +93,7 @@ struct instruction { DWORD opcode; DWORD dstmod; DWORD shift; - BWRITER_COMPARISON_TYPE comptype; + enum bwriter_comparison_type comptype; BOOL has_dst; struct shader_reg dst; struct shader_reg *src; @@ -218,9 +219,9 @@ struct asmparser_backend { void (*end)(struct asm_parser *This); - void (*instr)(struct asm_parser *This, DWORD opcode, DWORD mod, DWORD shift, - BWRITER_COMPARISON_TYPE comp, const struct shader_reg *dst, - const struct src_regs *srcs, int expectednsrcs); + void (*instr)(struct asm_parser *parser, DWORD opcode, DWORD mod, DWORD shift, + enum bwriter_comparison_type comp, const struct shader_reg *dst, + const struct src_regs *srcs, int expectednsrcs); }; struct instruction *alloc_instr(unsigned int srcs) DECLSPEC_HIDDEN; @@ -367,11 +368,10 @@ const char *debug_print_opcode(DWORD opcode) DECLSPEC_HIDDEN; /* Used to signal an incorrect swizzle/writemask */ #define SWIZZLE_ERR ~0U -/* - Enumerations and defines used in the bytecode writer - intermediate representation -*/ -typedef enum _BWRITERSHADER_INSTRUCTION_OPCODE_TYPE { +/* Enumerations and defines used in the bytecode writer intermediate + * representation. */ +enum bwritershader_instruction_opcode_type +{ BWRITERSIO_NOP, BWRITERSIO_MOV, BWRITERSIO_ADD, @@ -460,9 +460,10 @@ typedef enum _BWRITERSHADER_INSTRUCTION_OPCODE_TYPE { BWRITERSIO_PHASE, BWRITERSIO_COMMENT, BWRITERSIO_END, -} BWRITERSHADER_INSTRUCTION_OPCODE_TYPE; +}; -typedef enum _BWRITERSHADER_PARAM_REGISTER_TYPE { +enum bwritershader_param_register_type +{ BWRITERSPR_TEMP, BWRITERSPR_INPUT, BWRITERSPR_CONST, @@ -481,14 +482,14 @@ typedef enum _BWRITERSHADER_PARAM_REGISTER_TYPE { BWRITERSPR_MISCTYPE, BWRITERSPR_LABEL, BWRITERSPR_PREDICATE -} BWRITERSHADER_PARAM_REGISTER_TYPE; +}; -typedef enum _BWRITERVS_RASTOUT_OFFSETS +enum bwritervs_rastout_offsets { BWRITERSRO_POSITION, BWRITERSRO_FOG, BWRITERSRO_POINT_SIZE -} BWRITERVS_RASTOUT_OFFSETS; +}; #define BWRITERSP_WRITEMASK_0 0x1 /* .x r */ #define BWRITERSP_WRITEMASK_1 0x2 /* .y g */ @@ -496,25 +497,28 @@ typedef enum _BWRITERVS_RASTOUT_OFFSETS #define BWRITERSP_WRITEMASK_3 0x8 /* .w a */ #define BWRITERSP_WRITEMASK_ALL 0xf /* all */ -typedef enum _BWRITERSHADER_PARAM_DSTMOD_TYPE { +enum bwritershader_param_dstmod_type +{ BWRITERSPDM_NONE = 0, BWRITERSPDM_SATURATE = 1, BWRITERSPDM_PARTIALPRECISION = 2, BWRITERSPDM_MSAMPCENTROID = 4, -} BWRITERSHADER_PARAM_DSTMOD_TYPE; +}; -typedef enum _BWRITERSAMPLER_TEXTURE_TYPE { +enum bwritersampler_texture_type +{ BWRITERSTT_UNKNOWN = 0, BWRITERSTT_1D = 1, BWRITERSTT_2D = 2, BWRITERSTT_CUBE = 3, BWRITERSTT_VOLUME = 4, -} BWRITERSAMPLER_TEXTURE_TYPE; +}; #define BWRITERSI_TEXLD_PROJECT 1 #define BWRITERSI_TEXLD_BIAS 2 -typedef enum _BWRITERSHADER_PARAM_SRCMOD_TYPE { +enum bwritershader_param_srcmod_type +{ BWRITERSPSM_NONE = 0, BWRITERSPSM_NEG, BWRITERSPSM_BIAS, @@ -529,7 +533,7 @@ typedef enum _BWRITERSHADER_PARAM_SRCMOD_TYPE { BWRITERSPSM_ABS, BWRITERSPSM_ABSNEG, BWRITERSPSM_NOT, -} BWRITERSHADER_PARAM_SRCMOD_TYPE; +}; #define BWRITER_SM1_VS 0xfffe #define BWRITER_SM1_PS 0xffff @@ -567,7 +571,8 @@ typedef enum _BWRITERSHADER_PARAM_SRCMOD_TYPE { #define BWRITERVS_SWIZZLE_Z (BWRITERVS_X_Z | BWRITERVS_Y_Z | BWRITERVS_Z_Z | BWRITERVS_W_Z) #define BWRITERVS_SWIZZLE_W (BWRITERVS_X_W | BWRITERVS_Y_W | BWRITERVS_Z_W | BWRITERVS_W_W) -typedef enum _BWRITERDECLUSAGE { +enum bwriterdeclusage +{ BWRITERDECLUSAGE_POSITION, BWRITERDECLUSAGE_BLENDWEIGHT, BWRITERDECLUSAGE_BLENDINDICES, @@ -582,7 +587,7 @@ typedef enum _BWRITERDECLUSAGE { BWRITERDECLUSAGE_FOG, BWRITERDECLUSAGE_DEPTH, BWRITERDECLUSAGE_SAMPLE -} BWRITERDECLUSAGE; +}; /* ps 1.x texture registers mappings */ #define T0_REG 2 diff --git a/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c b/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c index c6fc3e4a4e2..a3e98d5543c 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c @@ -360,7 +360,7 @@ void hlsl_free (void * ); /* Begin user sect3 */ -#define hlsl_wrap() 1 +#define hlsl_wrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/reflection.c b/reactos/dll/directx/wine/d3dcompiler_43/reflection.c index 8cc1fe44f6c..becdee36acc 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/reflection.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/reflection.c @@ -69,7 +69,7 @@ struct d3dcompiler_shader_reflection_variable UINT start_offset; UINT size; UINT flags; - LPVOID default_value; + void *default_value; }; struct d3dcompiler_shader_reflection_constant_buffer @@ -179,7 +179,7 @@ static BOOL copy_value(const char *ptr, void **value, DWORD size) *value = HeapAlloc(GetProcessHeap(), 0, size); if (!*value) { - ERR("Failed to allocate vlaue memory.\n"); + ERR("Failed to allocate value memory.\n"); return FALSE; } @@ -442,7 +442,7 @@ static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompil } static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByName( - ID3D11ShaderReflection *iface, LPCSTR name) + ID3D11ShaderReflection *iface, const char *name) { struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface); unsigned int i; @@ -544,7 +544,7 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetPatchConstantP } static struct ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetVariableByName( - ID3D11ShaderReflection *iface, LPCSTR name) + ID3D11ShaderReflection *iface, const char *name) { struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface); unsigned int i, k; @@ -579,7 +579,7 @@ static struct ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_sha } static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDescByName( - ID3D11ShaderReflection *iface, LPCSTR name, D3D11_SHADER_INPUT_BIND_DESC *desc) + ID3D11ShaderReflection *iface, const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc) { struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface); unsigned int i; @@ -658,7 +658,7 @@ static BOOL STDMETHODCALLTYPE d3dcompiler_shader_reflection_IsSampleFrequencySha { FIXME("iface %p stub!\n", iface); - return 0; + return FALSE; } static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetNumInterfaceSlots( @@ -764,7 +764,7 @@ static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_ref } static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByName( - ID3D11ShaderReflectionConstantBuffer *iface, LPCSTR name) + ID3D11ShaderReflectionConstantBuffer *iface, const char *name) { struct d3dcompiler_shader_reflection_constant_buffer *This = impl_from_ID3D11ShaderReflectionConstantBuffer(iface); unsigned int i; @@ -921,7 +921,7 @@ static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect } static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByName( - ID3D11ShaderReflectionType *iface, LPCSTR name) + ID3D11ShaderReflectionType *iface, const char *name) { struct d3dcompiler_shader_reflection_type *This = impl_from_ID3D11ShaderReflectionType(iface); unsigned int i; @@ -950,7 +950,7 @@ static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect return &null_type.ID3D11ShaderReflectionType_iface; } -static LPCSTR STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeName( +static const char * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeName( ID3D11ShaderReflectionType *iface, UINT index) { struct d3dcompiler_shader_reflection_type *This = impl_from_ID3D11ShaderReflectionType(iface); diff --git a/reactos/dll/directx/wine/d3dcompiler_43/utils.c b/reactos/dll/directx/wine/d3dcompiler_43/utils.c index 001ba8ec55f..daa11b1b3ba 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/utils.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/utils.c @@ -1683,7 +1683,7 @@ struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *left, enum parse_assig static int compare_hlsl_types_rb(const void *key, const struct wine_rb_entry *entry) { - const char *name = (const char *)key; + const char *name = key; const struct hlsl_type *type = WINE_RB_ENTRY_VALUE(entry, const struct hlsl_type, scope_entry); if (name == type->name) @@ -1820,7 +1820,7 @@ static int compare_param_hlsl_types(const struct hlsl_type *t1, const struct hls static int compare_function_decl_rb(const void *key, const struct wine_rb_entry *entry) { - const struct list *params = (const struct list *)key; + const struct list *params = key; const struct hlsl_ir_function_decl *decl = WINE_RB_ENTRY_VALUE(entry, const struct hlsl_ir_function_decl, entry); int params_count = params ? list_count(params) : 0; int decl_params_count = decl->parameters ? list_count(decl->parameters) : 0; @@ -1855,7 +1855,7 @@ static const struct wine_rb_functions hlsl_ir_function_decl_rb_funcs = static int compare_function_rb(const void *key, const struct wine_rb_entry *entry) { - const char *name = (const char *)key; + const char *name = key; const struct hlsl_ir_function *func = WINE_RB_ENTRY_VALUE(entry, const struct hlsl_ir_function,entry); return strcmp(name, func->name); diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index e9b129cf6b1..43bbfd0396a 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -30,7 +30,7 @@ The following libraries are shared with Wine. reactos/dll/directx/wine/amstream # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3d8 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3d9 # Synced to Wine-1.7.17 -reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.1 +reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.1 reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.1 reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.17