From: Zebediah Figura zfigura@codeweavers.com
--- libs/vkd3d-utils/reflection.c | 444 +++++++++++++++++----------------- 1 file changed, 222 insertions(+), 222 deletions(-)
diff --git a/libs/vkd3d-utils/reflection.c b/libs/vkd3d-utils/reflection.c index 2d23df11b..1796a8428 100644 --- a/libs/vkd3d-utils/reflection.c +++ b/libs/vkd3d-utils/reflection.c @@ -22,57 +22,57 @@ #include <vkd3d_d3d12shader.h> #include "rbtree.h"
-enum D3DCOMPILER_SIGNATURE_ELEMENT_SIZE +enum signature_element_size { - D3DCOMPILER_SIGNATURE_ELEMENT_SIZE6 = 6, - D3DCOMPILER_SIGNATURE_ELEMENT_SIZE7 = 7, + SIGNATURE_ELEMENT_SIZE6 = 6, + SIGNATURE_ELEMENT_SIZE7 = 7, };
-#define D3DCOMPILER_SHADER_TARGET_VERSION_MASK 0xffff -#define D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK 0xffff0000 -#define D3DCOMPILER_SHADER_TARGET_SHADERTYPE_SHIFT 16 +#define SHADER_TARGET_VERSION_MASK 0xffff +#define SHADER_TARGET_SHADERTYPE_MASK 0xffff0000 +#define SHADER_TARGET_SHADERTYPE_SHIFT 16
-#define D3DCOMPILER_SHDR_SHADER_TYPE_CS 0x4353 +#define SHDR_SHADER_TYPE_CS 0x4353
-enum d3dcompiler_shader_type +enum shader_type { - D3DCOMPILER_SHADER_TYPE_CS = 5, + SHADER_TYPE_CS = 5, };
-struct d3dcompiler_shader_signature +struct shader_signature { D3D12_SIGNATURE_PARAMETER_DESC *elements; unsigned int element_count; char *string_data; };
-struct d3dcompiler_shader_reflection_type +struct reflection_type { ID3D12ShaderReflectionType ID3D12ShaderReflectionType_iface;
uint32_t id; struct rb_entry entry;
- struct d3dcompiler_shader_reflection *reflection; + struct reflection *reflection;
D3D12_SHADER_TYPE_DESC desc; - struct d3dcompiler_shader_reflection_type_member *members; + struct reflection_type_member *members; char *name; };
-struct d3dcompiler_shader_reflection_type_member +struct reflection_type_member { char *name; uint32_t offset; - struct d3dcompiler_shader_reflection_type *type; + struct reflection_type *type; };
-struct d3dcompiler_shader_reflection_variable +struct reflection_variable { ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable_iface;
- struct d3dcompiler_shader_reflection_constant_buffer *constant_buffer; - struct d3dcompiler_shader_reflection_type *type; + struct reflection_constant_buffer *constant_buffer; + struct reflection_type *type;
char *name; UINT start_offset; @@ -81,11 +81,11 @@ struct d3dcompiler_shader_reflection_variable void *default_value; };
-struct d3dcompiler_shader_reflection_constant_buffer +struct reflection_constant_buffer { ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer_iface;
- struct d3dcompiler_shader_reflection *reflection; + struct reflection *reflection;
char *name; D3D_CBUFFER_TYPE type; @@ -93,22 +93,22 @@ struct d3dcompiler_shader_reflection_constant_buffer UINT size; UINT flags;
- struct d3dcompiler_shader_reflection_variable *variables; + struct reflection_variable *variables; };
-enum D3DCOMPILER_REFLECTION_VERSION +enum REFLECTION_VERSION { - D3DCOMPILER_REFLECTION_VERSION_D3D10, - D3DCOMPILER_REFLECTION_VERSION_D3D11, - D3DCOMPILER_REFLECTION_VERSION_D3D12, + REFLECTION_VERSION_D3D10, + REFLECTION_VERSION_D3D11, + REFLECTION_VERSION_D3D12, };
-struct d3dcompiler_shader_reflection +struct reflection { ID3D12ShaderReflection ID3D12ShaderReflection_iface; LONG refcount;
- enum D3DCOMPILER_REFLECTION_VERSION interface_version; + enum REFLECTION_VERSION interface_version;
uint32_t target; char *creator; @@ -149,32 +149,32 @@ struct d3dcompiler_shader_reflection UINT thread_group_size_y; UINT thread_group_size_z;
- struct d3dcompiler_shader_signature *isgn; - struct d3dcompiler_shader_signature *osgn; - struct d3dcompiler_shader_signature *pcsg; + struct shader_signature *isgn; + struct shader_signature *osgn; + struct shader_signature *pcsg; char *resource_string; D3D12_SHADER_INPUT_BIND_DESC *bound_resources; - struct d3dcompiler_shader_reflection_constant_buffer *constant_buffers; + struct reflection_constant_buffer *constant_buffers; struct rb_tree types; };
-static struct d3dcompiler_shader_reflection_type *get_reflection_type(struct d3dcompiler_shader_reflection *reflection, const char *data, uint32_t offset); +static struct reflection_type *get_reflection_type(struct reflection *reflection, const char *data, uint32_t offset);
-static const struct ID3D12ShaderReflectionConstantBufferVtbl d3dcompiler_shader_reflection_constant_buffer_vtbl; -static const struct ID3D12ShaderReflectionVariableVtbl d3dcompiler_shader_reflection_variable_vtbl; -static const struct ID3D12ShaderReflectionTypeVtbl d3dcompiler_shader_reflection_type_vtbl; +static const struct ID3D12ShaderReflectionConstantBufferVtbl reflection_constant_buffer_vtbl; +static const struct ID3D12ShaderReflectionVariableVtbl reflection_variable_vtbl; +static const struct ID3D12ShaderReflectionTypeVtbl reflection_type_vtbl;
-static struct d3dcompiler_shader_reflection_constant_buffer null_constant_buffer = +static struct reflection_constant_buffer null_constant_buffer = { - {&d3dcompiler_shader_reflection_constant_buffer_vtbl}, + {&reflection_constant_buffer_vtbl}, }; -static struct d3dcompiler_shader_reflection_type null_type = +static struct reflection_type null_type = { - {&d3dcompiler_shader_reflection_type_vtbl}, + {&reflection_type_vtbl}, }; -static struct d3dcompiler_shader_reflection_variable null_variable = +static struct reflection_variable null_variable = { - {&d3dcompiler_shader_reflection_variable_vtbl}, + {&reflection_variable_vtbl}, &null_constant_buffer, &null_type }; @@ -232,23 +232,23 @@ static BOOL copy_value(const char *ptr, void **value, uint32_t size) return TRUE; }
-static int d3dcompiler_shader_reflection_type_compare(const void *key, const struct rb_entry *entry) +static int reflection_type_compare(const void *key, const struct rb_entry *entry) { - const struct d3dcompiler_shader_reflection_type *t = RB_ENTRY_VALUE(entry, const struct d3dcompiler_shader_reflection_type, entry); + const struct reflection_type *t = RB_ENTRY_VALUE(entry, const struct reflection_type, entry); const uint32_t *id = key;
return *id - t->id; }
-static void free_type_member(struct d3dcompiler_shader_reflection_type_member *member) +static void free_type_member(struct reflection_type_member *member) { if (member) vkd3d_free(member->name); }
-static void d3dcompiler_shader_reflection_type_destroy(struct rb_entry *entry, void *context) +static void reflection_type_destroy(struct rb_entry *entry, void *context) { - struct d3dcompiler_shader_reflection_type *t = RB_ENTRY_VALUE(entry, struct d3dcompiler_shader_reflection_type, entry); + struct reflection_type *t = RB_ENTRY_VALUE(entry, struct reflection_type, entry);
TRACE("reflection type %p.\n", t);
@@ -263,7 +263,7 @@ static void d3dcompiler_shader_reflection_type_destroy(struct rb_entry *entry, v vkd3d_free(t); }
-static void free_signature(struct d3dcompiler_shader_signature *sig) +static void free_signature(struct shader_signature *sig) { TRACE("Free signature %p.\n", sig);
@@ -271,7 +271,7 @@ static void free_signature(struct d3dcompiler_shader_signature *sig) vkd3d_free(sig->string_data); }
-static void free_variable(struct d3dcompiler_shader_reflection_variable *var) +static void free_variable(struct reflection_variable *var) { if (var) { @@ -280,7 +280,7 @@ static void free_variable(struct d3dcompiler_shader_reflection_variable *var) } }
-static void free_constant_buffer(struct d3dcompiler_shader_reflection_constant_buffer *cb) +static void free_constant_buffer(struct reflection_constant_buffer *cb) { if (cb->variables) { @@ -292,7 +292,7 @@ static void free_constant_buffer(struct d3dcompiler_shader_reflection_constant_b vkd3d_free(cb->name); }
-static void reflection_cleanup(struct d3dcompiler_shader_reflection *ref) +static void reflection_cleanup(struct reflection *ref) { TRACE("Cleanup %p.\n", ref);
@@ -320,19 +320,19 @@ static void reflection_cleanup(struct d3dcompiler_shader_reflection *ref) free_constant_buffer(&ref->constant_buffers[i]); }
- rb_destroy(&ref->types, d3dcompiler_shader_reflection_type_destroy, NULL); + rb_destroy(&ref->types, reflection_type_destroy, NULL); vkd3d_free(ref->constant_buffers); vkd3d_free(ref->bound_resources); vkd3d_free(ref->resource_string); vkd3d_free(ref->creator); }
-static struct d3dcompiler_shader_reflection *impl_from_ID3D12ShaderReflection(ID3D12ShaderReflection *iface) +static struct reflection *impl_from_ID3D12ShaderReflection(ID3D12ShaderReflection *iface) { - return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection, ID3D12ShaderReflection_iface); + return CONTAINING_RECORD(iface, struct reflection, ID3D12ShaderReflection_iface); }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_QueryInterface(ID3D12ShaderReflection *iface, REFIID iid, void **object) +static HRESULT STDMETHODCALLTYPE reflection_QueryInterface(ID3D12ShaderReflection *iface, REFIID iid, void **object) { TRACE("iface %p, iid %s, object %p.\n", iface, debugstr_guid(iid), object);
@@ -349,9 +349,9 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_QueryInterface(ID return E_NOINTERFACE; }
-static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_AddRef(ID3D12ShaderReflection *iface) +static ULONG STDMETHODCALLTYPE reflection_AddRef(ID3D12ShaderReflection *iface) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface); ULONG refcount = InterlockedIncrement(&reflection->refcount);
TRACE("%p increasing refcount to %u.\n", reflection, refcount); @@ -359,9 +359,9 @@ static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_AddRef(ID3D12Shader return refcount; }
-static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_Release(ID3D12ShaderReflection *iface) +static ULONG STDMETHODCALLTYPE reflection_Release(ID3D12ShaderReflection *iface) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface); ULONG refcount = InterlockedDecrement(&reflection->refcount);
TRACE("%p decreasing refcount to %u.\n", reflection, refcount); @@ -375,9 +375,9 @@ static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_Release(ID3D12Shade return refcount; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc(ID3D12ShaderReflection *iface, D3D12_SHADER_DESC *desc) +static HRESULT STDMETHODCALLTYPE reflection_GetDesc(ID3D12ShaderReflection *iface, D3D12_SHADER_DESC *desc) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
FIXME("iface %p, desc %p partial stub!\n", iface, desc);
@@ -429,10 +429,10 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc(ID3D12Sha return S_OK; }
-static struct ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByIndex( +static struct ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE reflection_GetConstantBufferByIndex( ID3D12ShaderReflection *iface, UINT index) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p, index %u.\n", iface, index);
@@ -445,10 +445,10 @@ static struct ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompil return &reflection->constant_buffers[index].ID3D12ShaderReflectionConstantBuffer_iface; }
-static struct ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByName( +static struct ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE reflection_GetConstantBufferByName( ID3D12ShaderReflection *iface, const char *name) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
@@ -460,7 +460,7 @@ static struct ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompil
for (unsigned int i = 0; i < reflection->constant_buffer_count; ++i) { - struct d3dcompiler_shader_reflection_constant_buffer *d = &reflection->constant_buffers[i]; + struct reflection_constant_buffer *d = &reflection->constant_buffers[i];
if (!strcmp(d->name, name)) { @@ -474,10 +474,10 @@ static struct ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompil return &null_constant_buffer.ID3D12ShaderReflectionConstantBuffer_iface; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDesc( +static HRESULT STDMETHODCALLTYPE reflection_GetResourceBindingDesc( ID3D12ShaderReflection *iface, UINT index, D3D12_SHADER_INPUT_BIND_DESC *desc) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
@@ -488,16 +488,16 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindin }
memcpy(desc, &reflection->bound_resources[index], - reflection->interface_version == D3DCOMPILER_REFLECTION_VERSION_D3D12 + reflection->interface_version == REFLECTION_VERSION_D3D12 ? sizeof(D3D12_SHADER_INPUT_BIND_DESC) : sizeof(D3D12_SHADER_INPUT_BIND_DESC));
return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetInputParameterDesc( +static HRESULT STDMETHODCALLTYPE reflection_GetInputParameterDesc( ID3D12ShaderReflection *iface, UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
@@ -512,10 +512,10 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetInputParameter return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetOutputParameterDesc( +static HRESULT STDMETHODCALLTYPE reflection_GetOutputParameterDesc( ID3D12ShaderReflection *iface, UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
@@ -530,10 +530,10 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetOutputParamete return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetPatchConstantParameterDesc( +static HRESULT STDMETHODCALLTYPE reflection_GetPatchConstantParameterDesc( ID3D12ShaderReflection *iface, UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
@@ -548,10 +548,10 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetPatchConstantP return S_OK; }
-static struct ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetVariableByName( +static struct ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE reflection_GetVariableByName( ID3D12ShaderReflection *iface, const char *name) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
@@ -563,11 +563,11 @@ static struct ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_sha
for (unsigned int i = 0; i < reflection->constant_buffer_count; ++i) { - struct d3dcompiler_shader_reflection_constant_buffer *cb = &reflection->constant_buffers[i]; + struct reflection_constant_buffer *cb = &reflection->constant_buffers[i];
for (unsigned int k = 0; k < cb->variable_count; ++k) { - struct d3dcompiler_shader_reflection_variable *v = &cb->variables[k]; + struct reflection_variable *v = &cb->variables[k];
if (!strcmp(v->name, name)) { @@ -582,10 +582,10 @@ static struct ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_sha return &null_variable.ID3D12ShaderReflectionVariable_iface; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDescByName( +static HRESULT STDMETHODCALLTYPE reflection_GetResourceBindingDescByName( ID3D12ShaderReflection *iface, const char *name, D3D12_SHADER_INPUT_BIND_DESC *desc) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p, name %s, desc %p.\n", iface, debugstr_a(name), desc);
@@ -602,7 +602,7 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindin if (!strcmp(d->Name, name)) { TRACE("Returning D3D12_SHADER_INPUT_BIND_DESC %p.\n", d); - memcpy(desc, d, reflection->interface_version == D3DCOMPILER_REFLECTION_VERSION_D3D12 + memcpy(desc, d, reflection->interface_version == REFLECTION_VERSION_D3D12 ? sizeof(D3D12_SHADER_INPUT_BIND_DESC) : sizeof(D3D12_SHADER_INPUT_BIND_DESC)); return S_OK; } @@ -613,17 +613,17 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindin return E_INVALIDARG; }
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovInstructionCount( +static UINT STDMETHODCALLTYPE reflection_GetMovInstructionCount( ID3D12ShaderReflection *iface) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p.\n", iface);
return reflection->mov_instruction_count; }
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovcInstructionCount( +static UINT STDMETHODCALLTYPE reflection_GetMovcInstructionCount( ID3D12ShaderReflection *iface) { FIXME("iface %p stub!\n", iface); @@ -631,17 +631,17 @@ static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovcInstructionCo return 0; }
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConversionInstructionCount( +static UINT STDMETHODCALLTYPE reflection_GetConversionInstructionCount( ID3D12ShaderReflection *iface) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p.\n", iface);
return reflection->conversion_instruction_count; }
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetBitwiseInstructionCount( +static UINT STDMETHODCALLTYPE reflection_GetBitwiseInstructionCount( ID3D12ShaderReflection *iface) { FIXME("iface %p stub!\n", iface); @@ -649,7 +649,7 @@ static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetBitwiseInstructio return 0; }
-static D3D_PRIMITIVE STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetGSInputPrimitive( +static D3D_PRIMITIVE STDMETHODCALLTYPE reflection_GetGSInputPrimitive( ID3D12ShaderReflection *iface) { FIXME("iface %p stub!\n", iface); @@ -657,7 +657,7 @@ static D3D_PRIMITIVE STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetGSInputP return 0; }
-static BOOL STDMETHODCALLTYPE d3dcompiler_shader_reflection_IsSampleFrequencyShader( +static BOOL STDMETHODCALLTYPE reflection_IsSampleFrequencyShader( ID3D12ShaderReflection *iface) { FIXME("iface %p stub!\n", iface); @@ -665,7 +665,7 @@ static BOOL STDMETHODCALLTYPE d3dcompiler_shader_reflection_IsSampleFrequencySha return FALSE; }
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetNumInterfaceSlots( +static UINT STDMETHODCALLTYPE reflection_GetNumInterfaceSlots( ID3D12ShaderReflection *iface) { FIXME("iface %p stub!\n", iface); @@ -673,7 +673,7 @@ static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetNumInterfaceSlots return 0; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMinFeatureLevel( +static HRESULT STDMETHODCALLTYPE reflection_GetMinFeatureLevel( ID3D12ShaderReflection *iface, D3D_FEATURE_LEVEL *level) { FIXME("iface %p, level %p stub!\n", iface, level); @@ -681,10 +681,10 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMinFeatureLeve return E_NOTIMPL; }
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetThreadGroupSize( +static UINT STDMETHODCALLTYPE reflection_GetThreadGroupSize( ID3D12ShaderReflection *iface, UINT *sizex, UINT *sizey, UINT *sizez) { - struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D12ShaderReflection(iface); + struct reflection *reflection = impl_from_ID3D12ShaderReflection(iface);
TRACE("iface %p, sizex %p, sizey %p, sizez %p.\n", iface, sizex, sizey, sizez);
@@ -701,7 +701,7 @@ static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetThreadGroupSize( return *sizex * *sizey * *sizez; }
-static UINT64 STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetRequiresFlags( +static UINT64 STDMETHODCALLTYPE reflection_GetRequiresFlags( ID3D12ShaderReflection *iface) { FIXME("iface %p stub!\n", iface); @@ -709,41 +709,41 @@ static UINT64 STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetRequiresFlags( return 0; }
-static const struct ID3D12ShaderReflectionVtbl d3dcompiler_shader_reflection_vtbl = -{ - d3dcompiler_shader_reflection_QueryInterface, - d3dcompiler_shader_reflection_AddRef, - d3dcompiler_shader_reflection_Release, - d3dcompiler_shader_reflection_GetDesc, - d3dcompiler_shader_reflection_GetConstantBufferByIndex, - d3dcompiler_shader_reflection_GetConstantBufferByName, - d3dcompiler_shader_reflection_GetResourceBindingDesc, - d3dcompiler_shader_reflection_GetInputParameterDesc, - d3dcompiler_shader_reflection_GetOutputParameterDesc, - d3dcompiler_shader_reflection_GetPatchConstantParameterDesc, - d3dcompiler_shader_reflection_GetVariableByName, - d3dcompiler_shader_reflection_GetResourceBindingDescByName, - d3dcompiler_shader_reflection_GetMovInstructionCount, - d3dcompiler_shader_reflection_GetMovcInstructionCount, - d3dcompiler_shader_reflection_GetConversionInstructionCount, - d3dcompiler_shader_reflection_GetBitwiseInstructionCount, - d3dcompiler_shader_reflection_GetGSInputPrimitive, - d3dcompiler_shader_reflection_IsSampleFrequencyShader, - d3dcompiler_shader_reflection_GetNumInterfaceSlots, - d3dcompiler_shader_reflection_GetMinFeatureLevel, - d3dcompiler_shader_reflection_GetThreadGroupSize, - d3dcompiler_shader_reflection_GetRequiresFlags, +static const struct ID3D12ShaderReflectionVtbl reflection_vtbl = +{ + reflection_QueryInterface, + reflection_AddRef, + reflection_Release, + reflection_GetDesc, + reflection_GetConstantBufferByIndex, + reflection_GetConstantBufferByName, + reflection_GetResourceBindingDesc, + reflection_GetInputParameterDesc, + reflection_GetOutputParameterDesc, + reflection_GetPatchConstantParameterDesc, + reflection_GetVariableByName, + reflection_GetResourceBindingDescByName, + reflection_GetMovInstructionCount, + reflection_GetMovcInstructionCount, + reflection_GetConversionInstructionCount, + reflection_GetBitwiseInstructionCount, + reflection_GetGSInputPrimitive, + reflection_IsSampleFrequencyShader, + reflection_GetNumInterfaceSlots, + reflection_GetMinFeatureLevel, + reflection_GetThreadGroupSize, + reflection_GetRequiresFlags, };
-static struct d3dcompiler_shader_reflection_constant_buffer *impl_from_ID3D11ShaderReflectionConstantBuffer(ID3D12ShaderReflectionConstantBuffer *iface) +static struct reflection_constant_buffer *impl_from_ID3D11ShaderReflectionConstantBuffer(ID3D12ShaderReflectionConstantBuffer *iface) { - return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_constant_buffer, ID3D12ShaderReflectionConstantBuffer_iface); + return CONTAINING_RECORD(iface, struct reflection_constant_buffer, ID3D12ShaderReflectionConstantBuffer_iface); }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetDesc( +static HRESULT STDMETHODCALLTYPE reflection_constant_buffer_GetDesc( ID3D12ShaderReflectionConstantBuffer *iface, D3D12_SHADER_BUFFER_DESC *desc) { - struct d3dcompiler_shader_reflection_constant_buffer *cb = impl_from_ID3D11ShaderReflectionConstantBuffer(iface); + struct reflection_constant_buffer *cb = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
TRACE("iface %p, desc %p.\n", iface, desc);
@@ -768,10 +768,10 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_G return S_OK; }
-static ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByIndex( +static ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE reflection_constant_buffer_GetVariableByIndex( ID3D12ShaderReflectionConstantBuffer *iface, UINT index) { - struct d3dcompiler_shader_reflection_constant_buffer *cb = impl_from_ID3D11ShaderReflectionConstantBuffer(iface); + struct reflection_constant_buffer *cb = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
TRACE("iface %p, index %u.\n", iface, index);
@@ -784,10 +784,10 @@ static ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_ref return &cb->variables[index].ID3D12ShaderReflectionVariable_iface; }
-static ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByName( +static ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE reflection_constant_buffer_GetVariableByName( ID3D12ShaderReflectionConstantBuffer *iface, const char *name) { - struct d3dcompiler_shader_reflection_constant_buffer *cb = impl_from_ID3D11ShaderReflectionConstantBuffer(iface); + struct reflection_constant_buffer *cb = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
@@ -799,7 +799,7 @@ static ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_ref
for (unsigned int i = 0; i < cb->variable_count; ++i) { - struct d3dcompiler_shader_reflection_variable *v = &cb->variables[i]; + struct reflection_variable *v = &cb->variables[i];
if (!strcmp(v->name, name)) { @@ -813,22 +813,22 @@ static ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_ref return &null_variable.ID3D12ShaderReflectionVariable_iface; }
-static const struct ID3D12ShaderReflectionConstantBufferVtbl d3dcompiler_shader_reflection_constant_buffer_vtbl = +static const struct ID3D12ShaderReflectionConstantBufferVtbl reflection_constant_buffer_vtbl = { - d3dcompiler_shader_reflection_constant_buffer_GetDesc, - d3dcompiler_shader_reflection_constant_buffer_GetVariableByIndex, - d3dcompiler_shader_reflection_constant_buffer_GetVariableByName, + reflection_constant_buffer_GetDesc, + reflection_constant_buffer_GetVariableByIndex, + reflection_constant_buffer_GetVariableByName, };
-static struct d3dcompiler_shader_reflection_variable *impl_from_ID3D11ShaderReflectionVariable(ID3D12ShaderReflectionVariable *iface) +static struct reflection_variable *impl_from_ID3D11ShaderReflectionVariable(ID3D12ShaderReflectionVariable *iface) { - return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_variable, ID3D12ShaderReflectionVariable_iface); + return CONTAINING_RECORD(iface, struct reflection_variable, ID3D12ShaderReflectionVariable_iface); }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetDesc( +static HRESULT STDMETHODCALLTYPE reflection_variable_GetDesc( ID3D12ShaderReflectionVariable *iface, D3D12_SHADER_VARIABLE_DESC *desc) { - struct d3dcompiler_shader_reflection_variable *variable = impl_from_ID3D11ShaderReflectionVariable(iface); + struct reflection_variable *variable = impl_from_ID3D11ShaderReflectionVariable(iface);
TRACE("iface %p, desc %p.\n", iface, desc);
@@ -859,27 +859,27 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetDesc( return S_OK; }
-static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetType( +static ID3D12ShaderReflectionType * STDMETHODCALLTYPE reflection_variable_GetType( ID3D12ShaderReflectionVariable *iface) { - struct d3dcompiler_shader_reflection_variable *variable = impl_from_ID3D11ShaderReflectionVariable(iface); + struct reflection_variable *variable = impl_from_ID3D11ShaderReflectionVariable(iface);
TRACE("iface %p.\n", iface);
return &variable->type->ID3D12ShaderReflectionType_iface; }
-static ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetBuffer( +static ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE reflection_variable_GetBuffer( ID3D12ShaderReflectionVariable *iface) { - struct d3dcompiler_shader_reflection_variable *variable = impl_from_ID3D11ShaderReflectionVariable(iface); + struct reflection_variable *variable = impl_from_ID3D11ShaderReflectionVariable(iface);
TRACE("iface %p.\n", iface);
return &variable->constant_buffer->ID3D12ShaderReflectionConstantBuffer_iface; }
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetInterfaceSlot( +static UINT STDMETHODCALLTYPE reflection_variable_GetInterfaceSlot( ID3D12ShaderReflectionVariable *iface, UINT index) { FIXME("iface %p, index %u stub!\n", iface, index); @@ -887,23 +887,23 @@ static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetInterfac return 0; }
-static const struct ID3D12ShaderReflectionVariableVtbl d3dcompiler_shader_reflection_variable_vtbl = +static const struct ID3D12ShaderReflectionVariableVtbl reflection_variable_vtbl = { - d3dcompiler_shader_reflection_variable_GetDesc, - d3dcompiler_shader_reflection_variable_GetType, - d3dcompiler_shader_reflection_variable_GetBuffer, - d3dcompiler_shader_reflection_variable_GetInterfaceSlot, + reflection_variable_GetDesc, + reflection_variable_GetType, + reflection_variable_GetBuffer, + reflection_variable_GetInterfaceSlot, };
-static struct d3dcompiler_shader_reflection_type *impl_from_ID3D11ShaderReflectionType(ID3D12ShaderReflectionType *iface) +static struct reflection_type *impl_from_ID3D11ShaderReflectionType(ID3D12ShaderReflectionType *iface) { - return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_type, ID3D12ShaderReflectionType_iface); + return CONTAINING_RECORD(iface, struct reflection_type, ID3D12ShaderReflectionType_iface); }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetDesc( +static HRESULT STDMETHODCALLTYPE reflection_type_GetDesc( ID3D12ShaderReflectionType *iface, D3D12_SHADER_TYPE_DESC *desc) { - struct d3dcompiler_shader_reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface); + struct reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface);
TRACE("iface %p, desc %p.\n", iface, desc);
@@ -924,10 +924,10 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetDesc( return S_OK; }
-static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByIndex( +static ID3D12ShaderReflectionType * STDMETHODCALLTYPE reflection_type_GetMemberTypeByIndex( ID3D12ShaderReflectionType *iface, UINT index) { - struct d3dcompiler_shader_reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface); + struct reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface);
TRACE("iface %p, index %u.\n", iface, index);
@@ -940,10 +940,10 @@ static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect return &variable->members[index].type->ID3D12ShaderReflectionType_iface; }
-static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByName( +static ID3D12ShaderReflectionType * STDMETHODCALLTYPE reflection_type_GetMemberTypeByName( ID3D12ShaderReflectionType *iface, const char *name) { - struct d3dcompiler_shader_reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface); + struct reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
@@ -955,7 +955,7 @@ static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect
for (unsigned int i = 0; i < variable->desc.Members; ++i) { - struct d3dcompiler_shader_reflection_type_member *member = &variable->members[i]; + struct reflection_type_member *member = &variable->members[i];
if (!strcmp(member->name, name)) { @@ -969,10 +969,10 @@ static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect return &null_type.ID3D12ShaderReflectionType_iface; }
-static const char * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeName( +static const char * STDMETHODCALLTYPE reflection_type_GetMemberTypeName( ID3D12ShaderReflectionType *iface, UINT index) { - struct d3dcompiler_shader_reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface); + struct reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface);
TRACE("iface %p, index %u.\n", iface, index);
@@ -991,10 +991,10 @@ static const char * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemb return variable->members[index].name; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsEqual( +static HRESULT STDMETHODCALLTYPE reflection_type_IsEqual( ID3D12ShaderReflectionType *iface, ID3D12ShaderReflectionType *type) { - struct d3dcompiler_shader_reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface); + struct reflection_type *variable = impl_from_ID3D11ShaderReflectionType(iface);
TRACE("iface %p, type %p.\n", iface, type);
@@ -1010,7 +1010,7 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsEqual( return S_FALSE; }
-static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetSubType( +static ID3D12ShaderReflectionType * STDMETHODCALLTYPE reflection_type_GetSubType( ID3D12ShaderReflectionType *iface) { FIXME("iface %p stub!\n", iface); @@ -1018,7 +1018,7 @@ static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect return NULL; }
-static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetBaseClass( +static ID3D12ShaderReflectionType * STDMETHODCALLTYPE reflection_type_GetBaseClass( ID3D12ShaderReflectionType *iface) { FIXME("iface %p stub!\n", iface); @@ -1026,7 +1026,7 @@ static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect return NULL; }
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetNumInterfaces( +static UINT STDMETHODCALLTYPE reflection_type_GetNumInterfaces( ID3D12ShaderReflectionType *iface) { FIXME("iface %p stub!\n", iface); @@ -1034,7 +1034,7 @@ static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetNumInterface return 0; }
-static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetInterfaceByIndex( +static ID3D12ShaderReflectionType * STDMETHODCALLTYPE reflection_type_GetInterfaceByIndex( ID3D12ShaderReflectionType *iface, UINT index) { FIXME("iface %p, index %u stub!\n", iface, index); @@ -1042,7 +1042,7 @@ static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect return NULL; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsOfType( +static HRESULT STDMETHODCALLTYPE reflection_type_IsOfType( ID3D12ShaderReflectionType *iface, ID3D12ShaderReflectionType *type) { FIXME("iface %p, type %p stub!\n", iface, type); @@ -1050,7 +1050,7 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsOfType( return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_ImplementsInterface( +static HRESULT STDMETHODCALLTYPE reflection_type_ImplementsInterface( ID3D12ShaderReflectionType *iface, ID3D12ShaderReflectionType *base) { FIXME("iface %p, base %p stub!\n", iface, base); @@ -1058,22 +1058,22 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_ImplementsIn return E_NOTIMPL; }
-static const struct ID3D12ShaderReflectionTypeVtbl d3dcompiler_shader_reflection_type_vtbl = +static const struct ID3D12ShaderReflectionTypeVtbl reflection_type_vtbl = { - d3dcompiler_shader_reflection_type_GetDesc, - d3dcompiler_shader_reflection_type_GetMemberTypeByIndex, - d3dcompiler_shader_reflection_type_GetMemberTypeByName, - d3dcompiler_shader_reflection_type_GetMemberTypeName, - d3dcompiler_shader_reflection_type_IsEqual, - d3dcompiler_shader_reflection_type_GetSubType, - d3dcompiler_shader_reflection_type_GetBaseClass, - d3dcompiler_shader_reflection_type_GetNumInterfaces, - d3dcompiler_shader_reflection_type_GetInterfaceByIndex, - d3dcompiler_shader_reflection_type_IsOfType, - d3dcompiler_shader_reflection_type_ImplementsInterface, + reflection_type_GetDesc, + reflection_type_GetMemberTypeByIndex, + reflection_type_GetMemberTypeByName, + reflection_type_GetMemberTypeName, + reflection_type_IsEqual, + reflection_type_GetSubType, + reflection_type_GetBaseClass, + reflection_type_GetNumInterfaces, + reflection_type_GetInterfaceByIndex, + reflection_type_IsOfType, + reflection_type_ImplementsInterface, };
-static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, const char *data, size_t data_size) +static HRESULT parse_stat(struct reflection *r, const char *data, size_t data_size) { const char *ptr = data; size_t size = data_size >> 2; @@ -1193,8 +1193,8 @@ static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, c return E_FAIL; }
-static HRESULT d3dcompiler_parse_type_members(struct d3dcompiler_shader_reflection *ref, - struct d3dcompiler_shader_reflection_type_member *member, const char *data, const char **ptr) +static HRESULT parse_type_members(struct reflection *ref, + struct reflection_type_member *member, const char *data, const char **ptr) { uint32_t offset;
@@ -1223,9 +1223,9 @@ static HRESULT d3dcompiler_parse_type_members(struct d3dcompiler_shader_reflecti return S_OK; }
-static HRESULT d3dcompiler_parse_type(struct d3dcompiler_shader_reflection_type *type, const char *data, uint32_t offset) +static HRESULT parse_type(struct reflection_type *type, const char *data, uint32_t offset) { - struct d3dcompiler_shader_reflection_type_member *members = NULL; + struct reflection_type_member *members = NULL; const char *ptr = data + offset; D3D12_SHADER_TYPE_DESC *desc; uint32_t member_offset; @@ -1252,7 +1252,7 @@ static HRESULT d3dcompiler_parse_type(struct d3dcompiler_shader_reflection_type member_offset = read_u32(&ptr); TRACE("Member Offset %u.\n", member_offset);
- if ((type->reflection->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK) >= 0x500) + if ((type->reflection->target & SHADER_TARGET_VERSION_MASK) >= 0x500) skip_u32_unknown(&ptr, 4);
if (desc->Members) @@ -1268,7 +1268,7 @@ static HRESULT d3dcompiler_parse_type(struct d3dcompiler_shader_reflection_type
for (unsigned int i = 0; i < desc->Members; ++i) { - hr = d3dcompiler_parse_type_members(type->reflection, &members[i], data, &ptr2); + hr = parse_type_members(type->reflection, &members[i], data, &ptr2); if (hr != S_OK) { FIXME("Failed to parse type members.\n"); @@ -1277,7 +1277,7 @@ static HRESULT d3dcompiler_parse_type(struct d3dcompiler_shader_reflection_type } }
- if ((type->reflection->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK) >= 0x500) + if ((type->reflection->target & SHADER_TARGET_VERSION_MASK) >= 0x500) { offset = read_u32(&ptr); if (!copy_name(data + offset, &type->name)) @@ -1301,9 +1301,9 @@ err_out: return hr; }
-static struct d3dcompiler_shader_reflection_type *get_reflection_type(struct d3dcompiler_shader_reflection *reflection, const char *data, uint32_t offset) +static struct reflection_type *get_reflection_type(struct reflection *reflection, const char *data, uint32_t offset) { - struct d3dcompiler_shader_reflection_type *type; + struct reflection_type *type; struct rb_entry *entry; HRESULT hr;
@@ -1311,18 +1311,18 @@ static struct d3dcompiler_shader_reflection_type *get_reflection_type(struct d3d if (entry) { TRACE("Returning existing type.\n"); - return RB_ENTRY_VALUE(entry, struct d3dcompiler_shader_reflection_type, entry); + return RB_ENTRY_VALUE(entry, struct reflection_type, entry); }
type = vkd3d_calloc(1, sizeof(*type)); if (!type) return NULL;
- type->ID3D12ShaderReflectionType_iface.lpVtbl = &d3dcompiler_shader_reflection_type_vtbl; + type->ID3D12ShaderReflectionType_iface.lpVtbl = &reflection_type_vtbl; type->id = offset; type->reflection = reflection;
- hr = d3dcompiler_parse_type(type, data, offset); + hr = parse_type(type, data, offset); if (FAILED(hr)) { ERR("Failed to parse type info, hr %#x.\n", hr); @@ -1340,10 +1340,10 @@ static struct d3dcompiler_shader_reflection_type *get_reflection_type(struct d3d return type; }
-static HRESULT d3dcompiler_parse_variables(struct d3dcompiler_shader_reflection_constant_buffer *cb, +static HRESULT parse_variables(struct reflection_constant_buffer *cb, const char *data, size_t data_size, const char *ptr) { - struct d3dcompiler_shader_reflection_variable *variables; + struct reflection_variable *variables; HRESULT hr;
variables = vkd3d_calloc(cb->variable_count, sizeof(*variables)); @@ -1355,10 +1355,10 @@ static HRESULT d3dcompiler_parse_variables(struct d3dcompiler_shader_reflection_
for (unsigned int i = 0; i < cb->variable_count; i++) { - struct d3dcompiler_shader_reflection_variable *v = &variables[i]; + struct reflection_variable *v = &variables[i]; uint32_t offset;
- v->ID3D12ShaderReflectionVariable_iface.lpVtbl = &d3dcompiler_shader_reflection_variable_vtbl; + v->ID3D12ShaderReflectionVariable_iface.lpVtbl = &reflection_variable_vtbl; v->constant_buffer = cb;
offset = read_u32(&ptr); @@ -1398,7 +1398,7 @@ static HRESULT d3dcompiler_parse_variables(struct d3dcompiler_shader_reflection_ goto err_out; }
- if ((cb->reflection->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK) >= 0x500) + if ((cb->reflection->target & SHADER_TARGET_VERSION_MASK) >= 0x500) skip_u32_unknown(&ptr, 4); }
@@ -1415,9 +1415,9 @@ err_out: return hr; }
-static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, const char *data, size_t data_size) +static HRESULT parse_rdef(struct reflection *r, const char *data, size_t data_size) { - struct d3dcompiler_shader_reflection_constant_buffer *constant_buffers = NULL; + struct reflection_constant_buffer *constant_buffers = NULL; uint32_t offset, cbuffer_offset, resource_offset, creator_offset; D3D12_SHADER_INPUT_BIND_DESC *bound_resources = NULL; unsigned int string_data_offset, string_data_size; @@ -1444,7 +1444,7 @@ static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, c r->target = read_u32(&ptr); TRACE("Target: %#x.\n", r->target);
- target_version = r->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK; + target_version = r->target & SHADER_TARGET_VERSION_MASK;
r->flags = read_u32(&ptr); TRACE("Flags: %u.\n", r->flags); @@ -1545,9 +1545,9 @@ static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, c ptr = data + cbuffer_offset; for (unsigned int i = 0; i < r->constant_buffer_count; i++) { - struct d3dcompiler_shader_reflection_constant_buffer *cb = &constant_buffers[i]; + struct reflection_constant_buffer *cb = &constant_buffers[i];
- cb->ID3D12ShaderReflectionConstantBuffer_iface.lpVtbl = &d3dcompiler_shader_reflection_constant_buffer_vtbl; + cb->ID3D12ShaderReflectionConstantBuffer_iface.lpVtbl = &reflection_constant_buffer_vtbl; cb->reflection = r;
offset = read_u32(&ptr); @@ -1565,7 +1565,7 @@ static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, c offset = read_u32(&ptr); TRACE("Variable offset: %x.\n", offset);
- hr = d3dcompiler_parse_variables(cb, data, data_size, data + offset); + hr = parse_variables(cb, data, data_size, data + offset); if (hr != S_OK) { FIXME("Failed to parse variables.\n"); @@ -1601,10 +1601,10 @@ err_out: return hr; }
-static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *s, +static HRESULT parse_signature(struct shader_signature *s, const struct vkd3d_shader_dxbc_section_desc *section) { - enum D3DCOMPILER_SIGNATURE_ELEMENT_SIZE element_size; + enum signature_element_size element_size; const char *ptr = section->data.code; D3D12_SIGNATURE_PARAMETER_DESC *d; unsigned int string_data_offset; @@ -1615,18 +1615,18 @@ static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature * switch (section->tag) { case TAG_OSG5: - element_size = D3DCOMPILER_SIGNATURE_ELEMENT_SIZE7; + element_size = SIGNATURE_ELEMENT_SIZE7; break;
case TAG_ISGN: case TAG_OSGN: case TAG_PCSG: - element_size = D3DCOMPILER_SIGNATURE_ELEMENT_SIZE6; + element_size = SIGNATURE_ELEMENT_SIZE6; break;
default: FIXME("Unhandled section %08x!\n", section->tag); - element_size = D3DCOMPILER_SIGNATURE_ELEMENT_SIZE6; + element_size = SIGNATURE_ELEMENT_SIZE6; break; }
@@ -1661,7 +1661,7 @@ static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *
/* FIXME */ d[i].MinPrecision = D3D_MIN_PRECISION_DEFAULT; - if (element_size == D3DCOMPILER_SIGNATURE_ELEMENT_SIZE7) + if (element_size == SIGNATURE_ELEMENT_SIZE7) d[i].Stream = read_u32(&ptr);
name_offset = read_u32(&ptr); @@ -1702,7 +1702,7 @@ enum sm4_opcode SM5_OP_DCL_THREAD_GROUP = 0x9b, };
-static HRESULT d3dcompiler_parse_shdr(struct d3dcompiler_shader_reflection *r, const char *data, size_t data_size) +static HRESULT parse_shdr(struct reflection *r, const char *data, size_t data_size) { uint32_t opcode_token, opcode; uint32_t size, shader_type; @@ -1713,10 +1713,10 @@ static HRESULT d3dcompiler_parse_shdr(struct d3dcompiler_shader_reflection *r, c r->version = read_u32(&ptr); TRACE("Shader version: %u.\n", r->version);
- shader_type = (r->version & D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK) - >> D3DCOMPILER_SHADER_TARGET_SHADERTYPE_SHIFT; + shader_type = (r->version & SHADER_TARGET_SHADERTYPE_MASK) + >> SHADER_TARGET_SHADERTYPE_SHIFT;
- if (shader_type != D3DCOMPILER_SHADER_TYPE_CS) + if (shader_type != SHADER_TYPE_CS) { /* TODO: Check if anything else is needed from the SHDR or SHEX blob. */ return S_OK; @@ -1769,7 +1769,7 @@ static HRESULT d3dcompiler_parse_shdr(struct d3dcompiler_shader_reflection *r, c return S_OK; }
-static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_reflection *reflection, +static HRESULT reflection_init(struct reflection *reflection, const void *data, SIZE_T data_size) { const struct vkd3d_shader_code src_dxbc = {.code = data, .size = data_size}; @@ -1777,7 +1777,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl HRESULT hr = S_OK; int ret;
- rb_init(&reflection->types, d3dcompiler_shader_reflection_type_compare); + rb_init(&reflection->types, reflection_type_compare);
if ((ret = vkd3d_shader_parse_dxbc(&src_dxbc, 0, &src_dxbc_desc, NULL)) < 0) { @@ -1792,7 +1792,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl switch (section->tag) { case TAG_RDEF: - hr = d3dcompiler_parse_rdef(reflection, section->data.code, section->data.size); + hr = parse_rdef(reflection, section->data.code, section->data.size); if (FAILED(hr)) { WARN("Failed to parse RDEF section.\n"); @@ -1809,7 +1809,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl goto err_out; }
- hr = d3dcompiler_parse_signature(reflection->isgn, section); + hr = parse_signature(reflection->isgn, section); if (FAILED(hr)) { WARN("Failed to parse section ISGN.\n"); @@ -1827,7 +1827,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl goto err_out; }
- hr = d3dcompiler_parse_signature(reflection->osgn, section); + hr = parse_signature(reflection->osgn, section); if (FAILED(hr)) { WARN("Failed to parse section OSGN.\n"); @@ -1844,7 +1844,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl goto err_out; }
- hr = d3dcompiler_parse_signature(reflection->pcsg, section); + hr = parse_signature(reflection->pcsg, section); if (FAILED(hr)) { WARN("Failed to parse section PCSG.\n"); @@ -1854,7 +1854,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
case TAG_SHEX: case TAG_SHDR: - hr = d3dcompiler_parse_shdr(reflection, section->data.code, section->data.size); + hr = parse_shdr(reflection, section->data.code, section->data.size); if (FAILED(hr)) { WARN("Failed to parse SHDR section.\n"); @@ -1863,7 +1863,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl break;
case TAG_STAT: - hr = d3dcompiler_parse_stat(reflection, section->data.code, section->data.size); + hr = parse_stat(reflection, section->data.code, section->data.size); if (FAILED(hr)) { WARN("Failed to parse section STAT.\n"); @@ -1890,7 +1890,7 @@ err_out:
HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID iid, void **reflector) { - struct d3dcompiler_shader_reflection *object; + struct reflection *object; const uint32_t *temp = data; HRESULT hr;
@@ -1917,12 +1917,12 @@ HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID iid, void * if (!(object = vkd3d_calloc(1, sizeof(*object)))) return E_OUTOFMEMORY;
- object->ID3D12ShaderReflection_iface.lpVtbl = &d3dcompiler_shader_reflection_vtbl; + object->ID3D12ShaderReflection_iface.lpVtbl = &reflection_vtbl; object->refcount = 1; object->interface_version = IsEqualGUID(iid, &IID_ID3D12ShaderReflection) - ? D3DCOMPILER_REFLECTION_VERSION_D3D12 : D3DCOMPILER_REFLECTION_VERSION_D3D11; + ? REFLECTION_VERSION_D3D12 : REFLECTION_VERSION_D3D11;
- if (FAILED(hr = d3dcompiler_shader_reflection_init(object, data, data_size))) + if (FAILED(hr = reflection_init(object, data, data_size))) { vkd3d_free(object); return hr;