Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3dcompiler_43/reflection.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index bd064793587..8b893fe76db 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -124,6 +124,7 @@ struct d3dcompiler_shader_reflection UINT gs_max_output_vertex_count; D3D_PRIMITIVE input_primitive; UINT cut_instruction_count; + UINT def_count; UINT dcl_count; UINT static_flow_control_count; UINT float_instruction_count; @@ -138,6 +139,7 @@ struct d3dcompiler_shader_reflection UINT texture_bias_instructions; UINT texture_gradient_instructions; UINT dynamic_flow_control_count; + UINT macro_instruction_count; UINT c_control_points; D3D_TESSELLATOR_OUTPUT_PRIMITIVE hs_output_primitive; D3D_TESSELLATOR_PARTITIONING hs_partitioning; @@ -1098,7 +1100,8 @@ static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, c r->temp_register_count = read_dword(&ptr); TRACE("TempRegisterCount: %u\n", r->temp_register_count);
- skip_dword_unknown(&ptr, 1); + r->def_count = read_dword(&ptr); + TRACE("DefCount: %u\n", r->def_count);
r->dcl_count = read_dword(&ptr); TRACE("DclCount: %u\n", r->dcl_count); @@ -1118,7 +1121,8 @@ static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, c r->dynamic_flow_control_count = read_dword(&ptr); TRACE("DynamicFlowControlCount: %u\n", r->dynamic_flow_control_count);
- skip_dword_unknown(&ptr, 1); + r->macro_instruction_count = read_dword(&ptr); + TRACE("MacroInstructionCount: %u\n", r->macro_instruction_count);
r->temp_array_count = read_dword(&ptr); TRACE("TempArrayCount: %u\n", r->temp_array_count); @@ -1917,7 +1921,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetDesc(ID3D10ShaderRef { struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D10ShaderReflection(iface);
- FIXME("iface %p, desc %p partial stub!\n", iface, desc); + TRACE("iface %p, desc %p.\n", iface, desc);
if (!desc) { @@ -1935,7 +1939,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetDesc(ID3D10ShaderRef desc->InstructionCount = reflection->instruction_count; desc->TempRegisterCount = reflection->temp_register_count; desc->TempArrayCount = reflection->temp_array_count; - desc->DefCount = 0; + desc->DefCount = reflection->def_count; desc->DclCount = reflection->dcl_count; desc->TextureNormalInstructions = reflection->texture_normal_instructions; desc->TextureLoadInstructions = reflection->texture_load_instructions; @@ -1947,7 +1951,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetDesc(ID3D10ShaderRef desc->UintInstructionCount = reflection->uint_instruction_count; desc->StaticFlowControlCount = reflection->static_flow_control_count; desc->DynamicFlowControlCount = reflection->dynamic_flow_control_count; - desc->MacroInstructionCount = 0; + desc->MacroInstructionCount = reflection->macro_instruction_count; desc->ArrayInstructionCount = reflection->array_instruction_count; desc->CutInstructionCount = reflection->cut_instruction_count; desc->EmitInstructionCount = reflection->emit_instruction_count;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3dcompiler_43/reflection.c | 70 ++++++++++++++++---------------- 1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 8b893fe76db..97abad4da30 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -387,7 +387,7 @@ static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_Release(ID3D11Shade
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc(ID3D11ShaderReflection *iface, D3D11_SHADER_DESC *desc) { - struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface); + struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
FIXME("iface %p, desc %p partial stub!\n", iface, desc);
@@ -397,41 +397,41 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc(ID3D11Sha return E_FAIL; }
- desc->Version = This->version; - desc->Creator = This->creator; - desc->Flags = This->flags; - desc->ConstantBuffers = This->constant_buffer_count; - desc->BoundResources = This->bound_resource_count; - desc->InputParameters = This->isgn ? This->isgn->element_count : 0; - desc->OutputParameters = This->osgn ? This->osgn->element_count : 0; - desc->InstructionCount = This->instruction_count; - desc->TempRegisterCount = This->temp_register_count; - desc->TempArrayCount = This->temp_array_count; - desc->DefCount = 0; - desc->DclCount = This->dcl_count; - desc->TextureNormalInstructions = This->texture_normal_instructions; - desc->TextureLoadInstructions = This->texture_load_instructions; - desc->TextureCompInstructions = This->texture_comp_instructions; - desc->TextureBiasInstructions = This->texture_bias_instructions; - desc->TextureGradientInstructions = This->texture_gradient_instructions; - desc->FloatInstructionCount = This->float_instruction_count; - desc->IntInstructionCount = This->int_instruction_count; - desc->UintInstructionCount = This->uint_instruction_count; - desc->StaticFlowControlCount = This->static_flow_control_count; - desc->DynamicFlowControlCount = This->dynamic_flow_control_count; - desc->MacroInstructionCount = 0; - desc->ArrayInstructionCount = This->array_instruction_count; - desc->CutInstructionCount = This->cut_instruction_count; - desc->EmitInstructionCount = This->emit_instruction_count; - desc->GSOutputTopology = This->gs_output_topology; - desc->GSMaxOutputVertexCount = This->gs_max_output_vertex_count; - desc->InputPrimitive = This->input_primitive; - desc->PatchConstantParameters = This->pcsg ? This->pcsg->element_count : 0; + desc->Version = reflection->version; + desc->Creator = reflection->creator; + desc->Flags = reflection->flags; + desc->ConstantBuffers = reflection->constant_buffer_count; + desc->BoundResources = reflection->bound_resource_count; + desc->InputParameters = reflection->isgn ? reflection->isgn->element_count : 0; + desc->OutputParameters = reflection->osgn ? reflection->osgn->element_count : 0; + desc->InstructionCount = reflection->instruction_count; + desc->TempRegisterCount = reflection->temp_register_count; + desc->TempArrayCount = reflection->temp_array_count; + desc->DefCount = reflection->def_count; + desc->DclCount = reflection->dcl_count; + desc->TextureNormalInstructions = reflection->texture_normal_instructions; + desc->TextureLoadInstructions = reflection->texture_load_instructions; + desc->TextureCompInstructions = reflection->texture_comp_instructions; + desc->TextureBiasInstructions = reflection->texture_bias_instructions; + desc->TextureGradientInstructions = reflection->texture_gradient_instructions; + desc->FloatInstructionCount = reflection->float_instruction_count; + desc->IntInstructionCount = reflection->int_instruction_count; + desc->UintInstructionCount = reflection->uint_instruction_count; + desc->StaticFlowControlCount = reflection->static_flow_control_count; + desc->DynamicFlowControlCount = reflection->dynamic_flow_control_count; + desc->MacroInstructionCount = reflection->macro_instruction_count; + desc->ArrayInstructionCount = reflection->array_instruction_count; + desc->CutInstructionCount = reflection->cut_instruction_count; + desc->EmitInstructionCount = reflection->emit_instruction_count; + desc->GSOutputTopology = reflection->gs_output_topology; + desc->GSMaxOutputVertexCount = reflection->gs_max_output_vertex_count; + desc->InputPrimitive = reflection->input_primitive; + desc->PatchConstantParameters = reflection->pcsg ? reflection->pcsg->element_count : 0; desc->cGSInstanceCount = 0; - desc->cControlPoints = This->c_control_points; - desc->HSOutputPrimitive = This->hs_output_primitive; - desc->HSPartitioning = This->hs_partitioning; - desc->TessellatorDomain = This->tessellator_domain; + desc->cControlPoints = reflection->c_control_points; + desc->HSOutputPrimitive = reflection->hs_output_primitive; + desc->HSPartitioning = reflection->hs_partitioning; + desc->TessellatorDomain = reflection->tessellator_domain; desc->cBarrierInstructions = 0; desc->cInterlockedInstructions = 0; desc->cTextureStoreInstructions = 0;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Clean up.
dlls/d3dx10_43/compiler.c | 30 ++++++++++++++++++++++++++++++ dlls/d3dx10_43/d3dx10_43_main.c | 13 ------------- 2 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/dlls/d3dx10_43/compiler.c b/dlls/d3dx10_43/compiler.c index 932bdadea1a..0bda2712d76 100644 --- a/dlls/d3dx10_43/compiler.c +++ b/dlls/d3dx10_43/compiler.c @@ -18,6 +18,7 @@ */
#include "wine/debug.h" +#include "wine/heap.h"
#define COBJMACROS
@@ -93,3 +94,32 @@ HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SH
return hr; } + +HRESULT WINAPI D3DX10CreateEffectFromFileA(const char *filename, const D3D10_SHADER_MACRO *defines, + ID3D10Include *include, const char *profile, UINT shader_flags, UINT effect_flags, + ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3DX10ThreadPump *pump, + ID3D10Effect **effect, ID3D10Blob **errors, HRESULT *hresult) +{ + WCHAR *filenameW; + HRESULT hr; + int len; + + TRACE("filename %s, defines %p, include %p, profile %s, shader_flags %#x, effect_flags %#x, " + "device %p, effect_pool %p, pump %p, effect %p, errors %p, hresult %p.\n", + debugstr_a(filename), defines, include, debugstr_a(profile), shader_flags, effect_flags, + device, effect_pool, pump, effect, errors, hresult); + + if (!filename) + return E_INVALIDARG; + + len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); + if (!(filenameW = heap_alloc(len * sizeof(*filenameW)))) + return E_OUTOFMEMORY; + MultiByteToWideChar(CP_ACP, 0, filename, -1, filenameW, len); + + hr = D3DX10CreateEffectFromFileW(filenameW, defines, include, profile, shader_flags, + effect_flags, device, effect_pool, pump, effect, errors, hresult); + heap_free(filenameW); + + return hr; +} diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c index 2c53924ac20..42f29ad6239 100644 --- a/dlls/d3dx10_43/d3dx10_43_main.c +++ b/dlls/d3dx10_43/d3dx10_43_main.c @@ -48,19 +48,6 @@ BOOL WINAPI D3DX10CheckVersion(UINT d3dsdkvers, UINT d3dxsdkvers) return FALSE; }
-HRESULT WINAPI D3DX10CreateEffectFromFileA(const char *filename, const D3D10_SHADER_MACRO *defines, - ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, - ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, ID3D10Effect **effect, ID3D10Blob **errors, - HRESULT *hresult) -{ - FIXME("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " - "device %p, effectpool %p, pump %p, effect %p, errors %p, hresult %p\n", - debugstr_a(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, - device, effectpool, pump, effect, errors, hresult); - - return E_NOTIMPL; -} - HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(const void *data, SIZE_T datasize, const char *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, ID3DX10ThreadPump *pump, ID3D10EffectPool **effectpool,