Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
984ed6e9
Commit
984ed6e9
authored
Dec 21, 2010
by
Rico Schüller
Committed by
Alexandre Julliard
Dec 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Parse reflection STAT tag.
parent
8f08d385
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
147 additions
and
0 deletions
+147
-0
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+27
-0
reflection.c
dlls/d3dcompiler_43/reflection.c
+120
-0
No files found.
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
984ed6e9
...
...
@@ -62,6 +62,33 @@ struct d3dcompiler_shader_reflection
{
ID3D11ShaderReflection
ID3D11ShaderReflection_iface
;
LONG
refcount
;
UINT
mov_instruction_count
;
UINT
conversion_instruction_count
;
UINT
instruction_count
;
UINT
emit_instruction_count
;
D3D_PRIMITIVE_TOPOLOGY
gs_output_topology
;
UINT
gs_max_output_vertex_count
;
D3D_PRIMITIVE
input_primitive
;
UINT
cut_instruction_count
;
UINT
dcl_count
;
UINT
static_flow_control_count
;
UINT
float_instruction_count
;
UINT
temp_register_count
;
UINT
int_instruction_count
;
UINT
uint_instruction_count
;
UINT
temp_array_count
;
UINT
array_instruction_count
;
UINT
texture_normal_instructions
;
UINT
texture_load_instructions
;
UINT
texture_comp_instructions
;
UINT
texture_bias_instructions
;
UINT
texture_gradient_instructions
;
UINT
dynamic_flow_control_count
;
UINT
c_control_points
;
D3D_TESSELLATOR_OUTPUT_PRIMITIVE
hs_output_primitive
;
D3D_TESSELLATOR_PARTITIONING
hs_prtitioning
;
D3D_TESSELLATOR_DOMAIN
tessellator_domain
;
};
/* reflection handling */
...
...
dlls/d3dcompiler_43/reflection.c
View file @
984ed6e9
...
...
@@ -247,6 +247,116 @@ const struct ID3D11ShaderReflectionVtbl d3dcompiler_shader_reflection_vtbl =
d3dcompiler_shader_reflection_GetThreadGroupSize
,
};
static
HRESULT
d3dcompiler_parse_stat
(
struct
d3dcompiler_shader_reflection
*
r
,
const
char
*
data
,
DWORD
data_size
)
{
const
char
*
ptr
=
data
;
DWORD
size
=
data_size
>>
2
;
TRACE
(
"Size %u
\n
"
,
size
);
read_dword
(
&
ptr
,
&
r
->
instruction_count
);
TRACE
(
"InstructionCount: %u
\n
"
,
r
->
instruction_count
);
read_dword
(
&
ptr
,
&
r
->
temp_register_count
);
TRACE
(
"TempRegisterCount: %u
\n
"
,
r
->
temp_register_count
);
skip_dword_unknown
(
&
ptr
,
1
);
read_dword
(
&
ptr
,
&
r
->
dcl_count
);
TRACE
(
"DclCount: %u
\n
"
,
r
->
dcl_count
);
read_dword
(
&
ptr
,
&
r
->
float_instruction_count
);
TRACE
(
"FloatInstructionCount: %u
\n
"
,
r
->
float_instruction_count
);
read_dword
(
&
ptr
,
&
r
->
int_instruction_count
);
TRACE
(
"IntInstructionCount: %u
\n
"
,
r
->
int_instruction_count
);
read_dword
(
&
ptr
,
&
r
->
uint_instruction_count
);
TRACE
(
"UintInstructionCount: %u
\n
"
,
r
->
uint_instruction_count
);
read_dword
(
&
ptr
,
&
r
->
static_flow_control_count
);
TRACE
(
"StaticFlowControlCount: %u
\n
"
,
r
->
static_flow_control_count
);
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
->
temp_array_count
);
TRACE
(
"TempArrayCount: %u
\n
"
,
r
->
temp_array_count
);
read_dword
(
&
ptr
,
&
r
->
array_instruction_count
);
TRACE
(
"ArrayInstructionCount: %u
\n
"
,
r
->
array_instruction_count
);
read_dword
(
&
ptr
,
&
r
->
cut_instruction_count
);
TRACE
(
"CutInstructionCount: %u
\n
"
,
r
->
cut_instruction_count
);
read_dword
(
&
ptr
,
&
r
->
emit_instruction_count
);
TRACE
(
"EmitInstructionCount: %u
\n
"
,
r
->
emit_instruction_count
);
read_dword
(
&
ptr
,
&
r
->
texture_normal_instructions
);
TRACE
(
"TextureNormalInstructions: %u
\n
"
,
r
->
texture_normal_instructions
);
read_dword
(
&
ptr
,
&
r
->
texture_load_instructions
);
TRACE
(
"TextureLoadInstructions: %u
\n
"
,
r
->
texture_load_instructions
);
read_dword
(
&
ptr
,
&
r
->
texture_comp_instructions
);
TRACE
(
"TextureCompInstructions: %u
\n
"
,
r
->
texture_comp_instructions
);
read_dword
(
&
ptr
,
&
r
->
texture_bias_instructions
);
TRACE
(
"TextureBiasInstructions: %u
\n
"
,
r
->
texture_bias_instructions
);
read_dword
(
&
ptr
,
&
r
->
texture_gradient_instructions
);
TRACE
(
"TextureGradientInstructions: %u
\n
"
,
r
->
texture_gradient_instructions
);
read_dword
(
&
ptr
,
&
r
->
mov_instruction_count
);
TRACE
(
"MovInstructionCount: %u
\n
"
,
r
->
mov_instruction_count
);
skip_dword_unknown
(
&
ptr
,
1
);
read_dword
(
&
ptr
,
&
r
->
conversion_instruction_count
);
TRACE
(
"ConversionInstructionCount: %u
\n
"
,
r
->
conversion_instruction_count
);
skip_dword_unknown
(
&
ptr
,
1
);
read_dword
(
&
ptr
,
&
r
->
input_primitive
);
TRACE
(
"InputPrimitive: %x
\n
"
,
r
->
input_primitive
);
read_dword
(
&
ptr
,
&
r
->
gs_output_topology
);
TRACE
(
"GSOutputTopology: %x
\n
"
,
r
->
gs_output_topology
);
read_dword
(
&
ptr
,
&
r
->
gs_max_output_vertex_count
);
TRACE
(
"GSMaxOutputVertexCount: %u
\n
"
,
r
->
gs_max_output_vertex_count
);
skip_dword_unknown
(
&
ptr
,
3
);
/* dx10 stat size */
if
(
size
==
29
)
return
S_OK
;
skip_dword_unknown
(
&
ptr
,
1
);
read_dword
(
&
ptr
,
&
r
->
c_control_points
);
TRACE
(
"cControlPoints: %u
\n
"
,
r
->
c_control_points
);
read_dword
(
&
ptr
,
&
r
->
hs_output_primitive
);
TRACE
(
"HSOutputPrimitive: %x
\n
"
,
r
->
hs_output_primitive
);
read_dword
(
&
ptr
,
&
r
->
hs_prtitioning
);
TRACE
(
"HSPartitioning: %x
\n
"
,
r
->
hs_prtitioning
);
read_dword
(
&
ptr
,
&
r
->
tessellator_domain
);
TRACE
(
"TessellatorDomain: %x
\n
"
,
r
->
tessellator_domain
);
skip_dword_unknown
(
&
ptr
,
3
);
/* dx11 stat size */
if
(
size
==
37
)
return
S_OK
;
FIXME
(
"Unhandled size %u
\n
"
,
size
);
return
E_FAIL
;
}
HRESULT
d3dcompiler_shader_reflection_init
(
struct
d3dcompiler_shader_reflection
*
reflection
,
const
void
*
data
,
SIZE_T
data_size
)
{
...
...
@@ -270,6 +380,16 @@ HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_reflection
switch
(
section
->
tag
)
{
case
TAG_STAT
:
hr
=
d3dcompiler_parse_stat
(
reflection
,
section
->
data
,
section
->
data_size
);
if
(
FAILED
(
hr
))
{
dxbc_destroy
(
&
src_dxbc
);
WARN
(
"Failed to parse section STAT.
\n
"
);
return
hr
;
}
break
;
default:
FIXME
(
"Unhandled section %s!
\n
"
,
debugstr_an
((
const
char
*
)
&
section
->
tag
,
4
));
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment