From: Vijay Kiran Kamuju Subject: [d3dcompiler] - add missing fields to d3dcompiler_shader_reflection Message-Id: Date: Thu, 23 Jun 2016 01:45:09 +0200 [d3dcompiler] - add missing fields to d3dcompiler_shader_reflection This add missing fields to the d3dcompiler_shader_reflection based on http://timjones.tw/blog/archive/2015/09/02/parsing-direct3d-shader-bytecode https://msdn.microsoft.com/en-us/library/windows/desktop/ff476590(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/bb694550(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/bb172432(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ff476209(v=vs.85).aspx From f7f90a44e89908b478ad72324625d1e022d2d961 Mon Sep 17 00:00:00 2001 From: Vijay Kiran Kamuju Date: Thu, 23 Jun 2016 01:07:39 +0000 Subject: [PATCH] [d3dcompiler_43]Add missing fields for d3dcompiler_shader_reflection Signed-off-by: Vijay Kiran Kamuju --- dlls/d3dcompiler_43/reflection.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index e2955f0..eb94e5c 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -102,9 +102,12 @@ struct d3dcompiler_shader_reflection UINT version; UINT bound_resource_count; UINT constant_buffer_count; + UINT sample_frequency_shader; UINT mov_instruction_count; + UINT movc_instruction_count; UINT conversion_instruction_count; + UINT bitwise_instruction_count; UINT instruction_count; UINT emit_instruction_count; D3D_PRIMITIVE_TOPOLOGY gs_output_topology; @@ -112,6 +115,7 @@ struct d3dcompiler_shader_reflection D3D_PRIMITIVE input_primitive; UINT cut_instruction_count; UINT dcl_count; + UINT def_count; UINT static_flow_control_count; UINT float_instruction_count; UINT temp_register_count; @@ -125,10 +129,15 @@ struct d3dcompiler_shader_reflection UINT texture_bias_instructions; UINT texture_gradient_instructions; UINT dynamic_flow_control_count; + UINT macro_instruction_count; + UINT c_gs_instance_count; UINT c_control_points; D3D_TESSELLATOR_OUTPUT_PRIMITIVE hs_output_primitive; D3D_TESSELLATOR_PARTITIONING hs_prtitioning; D3D_TESSELLATOR_DOMAIN tessellator_domain; + UINT c_barrier_instructions; + UINT c_interlocked_instructions; + UINT c_texture_store_instructions; struct d3dcompiler_shader_signature *isgn; struct d3dcompiler_shader_signature *osgn; @@ -1071,7 +1080,8 @@ static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, c read_dword(&ptr, &r->temp_register_count); TRACE("TempRegisterCount: %u\n", r->temp_register_count); - skip_dword_unknown(&ptr, 1); + read_dword(&ptr, &r->def_count); + TRACE("DefCount: %u\n", r->def_count); read_dword(&ptr, &r->dcl_count); TRACE("DclCount: %u\n", r->dcl_count); @@ -1091,7 +1101,8 @@ static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, c read_dword(&ptr, &r->dynamic_flow_control_count); TRACE("DynamicFlowControlCount: %u\n", r->dynamic_flow_control_count); - skip_dword_unknown(&ptr, 1); + read_dword(&ptr, &r->macro_instruction_count); + TRACE("MacroInstructionCount: %u\n", r->macro_instruction_count); read_dword(&ptr, &r->temp_array_count); TRACE("TempArrayCount: %u\n", r->temp_array_count); @@ -1123,12 +1134,14 @@ static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, c read_dword(&ptr, &r->mov_instruction_count); TRACE("MovInstructionCount: %u\n", r->mov_instruction_count); - skip_dword_unknown(&ptr, 1); + read_dword(&ptr, &r->movc_instruction_count); + TRACE("MovcInstructionCount: %u\n", r->movc_instruction_count); read_dword(&ptr, &r->conversion_instruction_count); TRACE("ConversionInstructionCount: %u\n", r->conversion_instruction_count); - skip_dword_unknown(&ptr, 1); + read_dword(&ptr, &r->bitwise_instruction_count); + TRACE("BitwiseInstructionCount: %u\n", r->bitwise_instruction_count); read_dword(&ptr, &r->input_primitive); TRACE("InputPrimitive: %x\n", r->input_primitive); @@ -1139,12 +1152,16 @@ static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, c read_dword(&ptr, &r->gs_max_output_vertex_count); TRACE("GSMaxOutputVertexCount: %u\n", r->gs_max_output_vertex_count); - skip_dword_unknown(&ptr, 3); + skip_dword_unknown(&ptr, 2); + + read_dword(&ptr, &r->sample_frequency_shader); + TRACE("SampleFrequencyShader: %u\n", r->sample_frequency_shader); /* dx10 stat size */ if (size == 29) return S_OK; - skip_dword_unknown(&ptr, 1); + read_dword(&ptr, &r->c_gs_instance_count); + TRACE("cGSInstanceCount: %u\n", r->c_gs_instance_count); read_dword(&ptr, &r->c_control_points); TRACE("cControlPoints: %u\n", r->c_control_points); @@ -1158,7 +1175,14 @@ static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, c read_dword(&ptr, &r->tessellator_domain); TRACE("TessellatorDomain: %x\n", r->tessellator_domain); - skip_dword_unknown(&ptr, 3); + read_dword(&ptr, &r->c_barrier_instructions); + TRACE("cBarrierInstructions: %u\n", r->c_barrier_instructions); + + read_dword(&ptr, &r->c_interlocked_instructions); + TRACE("cInterlockedInstructions: %u\n", r->c_interlocked_instructions); + + read_dword(&ptr, &r->c_texture_store_instructions); + TRACE("cTextureStoreInstructions: %u\n", r->c_texture_store_instructions); /* dx11 stat size */ if (size == 37) return S_OK; -- 2.9.0