ReactOS 0.4.15-dev-7961-gdcf9eb0
reflection.c File Reference
#include "initguid.h"
#include "d3dcompiler_private.h"
#include "wine/winternl.h"
Include dependency graph for reflection.c:

Go to the source code of this file.

Classes

struct  d3dcompiler_shader_signature
 
struct  d3dcompiler_shader_reflection_type
 
struct  d3dcompiler_shader_reflection_type_member
 
struct  d3dcompiler_shader_reflection_variable
 
struct  d3dcompiler_shader_reflection_constant_buffer
 
struct  d3dcompiler_shader_reflection
 

Macros

#define D3DCOMPILER_SHADER_TARGET_VERSION_MASK   0xffff
 
#define D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK   0xffff0000
 

Enumerations

enum  D3DCOMPILER_SIGNATURE_ELEMENT_SIZE { D3DCOMPILER_SIGNATURE_ELEMENT_SIZE6 = 6 , D3DCOMPILER_SIGNATURE_ELEMENT_SIZE7 = 7 }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3dcompiler)
 
static struct d3dcompiler_shader_reflection_typeget_reflection_type (struct d3dcompiler_shader_reflection *reflection, const char *data, DWORD offset)
 
static BOOL copy_name (const char *ptr, char **name)
 
static BOOL copy_value (const char *ptr, void **value, DWORD size)
 
static int d3dcompiler_shader_reflection_type_compare (const void *key, const struct wine_rb_entry *entry)
 
static void free_type_member (struct d3dcompiler_shader_reflection_type_member *member)
 
static void d3dcompiler_shader_reflection_type_destroy (struct wine_rb_entry *entry, void *context)
 
static void free_signature (struct d3dcompiler_shader_signature *sig)
 
static void free_variable (struct d3dcompiler_shader_reflection_variable *var)
 
static void free_constant_buffer (struct d3dcompiler_shader_reflection_constant_buffer *cb)
 
static void reflection_cleanup (struct d3dcompiler_shader_reflection *ref)
 
static struct d3dcompiler_shader_reflectionimpl_from_ID3D11ShaderReflection (ID3D11ShaderReflection *iface)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_QueryInterface (ID3D11ShaderReflection *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_AddRef (ID3D11ShaderReflection *iface)
 
static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_Release (ID3D11ShaderReflection *iface)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc (ID3D11ShaderReflection *iface, D3D11_SHADER_DESC *desc)
 
static struct ID3D11ShaderReflectionConstantBuffer *STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByIndex (ID3D11ShaderReflection *iface, UINT index)
 
static struct ID3D11ShaderReflectionConstantBuffer *STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByName (ID3D11ShaderReflection *iface, const char *name)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDesc (ID3D11ShaderReflection *iface, UINT index, D3D11_SHADER_INPUT_BIND_DESC *desc)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetInputParameterDesc (ID3D11ShaderReflection *iface, UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetOutputParameterDesc (ID3D11ShaderReflection *iface, UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetPatchConstantParameterDesc (ID3D11ShaderReflection *iface, UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
 
static struct ID3D11ShaderReflectionVariable *STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetVariableByName (ID3D11ShaderReflection *iface, const char *name)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDescByName (ID3D11ShaderReflection *iface, const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc)
 
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovInstructionCount (ID3D11ShaderReflection *iface)
 
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovcInstructionCount (ID3D11ShaderReflection *iface)
 
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConversionInstructionCount (ID3D11ShaderReflection *iface)
 
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetBitwiseInstructionCount (ID3D11ShaderReflection *iface)
 
static D3D_PRIMITIVE STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetGSInputPrimitive (ID3D11ShaderReflection *iface)
 
static BOOL STDMETHODCALLTYPE d3dcompiler_shader_reflection_IsSampleFrequencyShader (ID3D11ShaderReflection *iface)
 
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetNumInterfaceSlots (ID3D11ShaderReflection *iface)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMinFeatureLevel (ID3D11ShaderReflection *iface, D3D_FEATURE_LEVEL *level)
 
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetThreadGroupSize (ID3D11ShaderReflection *iface, UINT *sizex, UINT *sizey, UINT *sizez)
 
static UINT64 STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetRequiresFlags (ID3D11ShaderReflection *iface)
 
static struct d3dcompiler_shader_reflection_constant_bufferimpl_from_ID3D11ShaderReflectionConstantBuffer (ID3D11ShaderReflectionConstantBuffer *iface)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetDesc (ID3D11ShaderReflectionConstantBuffer *iface, D3D11_SHADER_BUFFER_DESC *desc)
 
static ID3D11ShaderReflectionVariable *STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByIndex (ID3D11ShaderReflectionConstantBuffer *iface, UINT index)
 
static ID3D11ShaderReflectionVariable *STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByName (ID3D11ShaderReflectionConstantBuffer *iface, const char *name)
 
static struct d3dcompiler_shader_reflection_variableimpl_from_ID3D11ShaderReflectionVariable (ID3D11ShaderReflectionVariable *iface)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetDesc (ID3D11ShaderReflectionVariable *iface, D3D11_SHADER_VARIABLE_DESC *desc)
 
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetType (ID3D11ShaderReflectionVariable *iface)
 
static ID3D11ShaderReflectionConstantBuffer *STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetBuffer (ID3D11ShaderReflectionVariable *iface)
 
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetInterfaceSlot (ID3D11ShaderReflectionVariable *iface, UINT index)
 
static struct d3dcompiler_shader_reflection_typeimpl_from_ID3D11ShaderReflectionType (ID3D11ShaderReflectionType *iface)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetDesc (ID3D11ShaderReflectionType *iface, D3D11_SHADER_TYPE_DESC *desc)
 
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByIndex (ID3D11ShaderReflectionType *iface, UINT index)
 
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByName (ID3D11ShaderReflectionType *iface, const char *name)
 
static const char *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeName (ID3D11ShaderReflectionType *iface, UINT index)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsEqual (ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *type)
 
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetSubType (ID3D11ShaderReflectionType *iface)
 
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetBaseClass (ID3D11ShaderReflectionType *iface)
 
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetNumInterfaces (ID3D11ShaderReflectionType *iface)
 
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetInterfaceByIndex (ID3D11ShaderReflectionType *iface, UINT index)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsOfType (ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *type)
 
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_ImplementsInterface (ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *base)
 
static HRESULT d3dcompiler_parse_stat (struct d3dcompiler_shader_reflection *r, const char *data, DWORD data_size)
 
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 d3dcompiler_parse_type (struct d3dcompiler_shader_reflection_type *type, const char *data, DWORD offset)
 
static HRESULT d3dcompiler_parse_variables (struct d3dcompiler_shader_reflection_constant_buffer *cb, const char *data, DWORD data_size, const char *ptr)
 
static HRESULT d3dcompiler_parse_rdef (struct d3dcompiler_shader_reflection *r, const char *data, DWORD data_size)
 
static HRESULT d3dcompiler_parse_signature (struct d3dcompiler_shader_signature *s, struct dxbc_section *section, DWORD target)
 
static HRESULT d3dcompiler_parse_shdr (struct d3dcompiler_shader_reflection *r, const char *data, DWORD data_size)
 
static HRESULT d3dcompiler_shader_reflection_init (struct d3dcompiler_shader_reflection *reflection, const void *data, SIZE_T data_size)
 
HRESULT WINAPI D3DReflect (const void *data, SIZE_T data_size, REFIID riid, void **reflector)
 

Variables

static const struct ID3D11ShaderReflectionConstantBufferVtbl d3dcompiler_shader_reflection_constant_buffer_vtbl
 
static const struct ID3D11ShaderReflectionVariableVtbl d3dcompiler_shader_reflection_variable_vtbl
 
static const struct ID3D11ShaderReflectionTypeVtbl d3dcompiler_shader_reflection_type_vtbl
 
static struct d3dcompiler_shader_reflection_constant_buffer null_constant_buffer = {{&d3dcompiler_shader_reflection_constant_buffer_vtbl}}
 
static struct d3dcompiler_shader_reflection_type null_type = {{&d3dcompiler_shader_reflection_type_vtbl}}
 
static struct d3dcompiler_shader_reflection_variable null_variable
 
static const struct ID3D11ShaderReflectionVtbl d3dcompiler_shader_reflection_vtbl
 

Macro Definition Documentation

◆ D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK

#define D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK   0xffff0000

Definition at line 34 of file reflection.c.

◆ D3DCOMPILER_SHADER_TARGET_VERSION_MASK

#define D3DCOMPILER_SHADER_TARGET_VERSION_MASK   0xffff

Definition at line 33 of file reflection.c.

Enumeration Type Documentation

◆ D3DCOMPILER_SIGNATURE_ELEMENT_SIZE

Enumerator
D3DCOMPILER_SIGNATURE_ELEMENT_SIZE6 
D3DCOMPILER_SIGNATURE_ELEMENT_SIZE7 

Definition at line 27 of file reflection.c.

28{
31};
@ D3DCOMPILER_SIGNATURE_ELEMENT_SIZE7
Definition: reflection.c:30
@ D3DCOMPILER_SIGNATURE_ELEMENT_SIZE6
Definition: reflection.c:29

Function Documentation

◆ copy_name()

static BOOL copy_name ( const char ptr,
char **  name 
)
static

Definition at line 154 of file reflection.c.

155{
156 size_t name_len;
157
158 if (!ptr) return TRUE;
159
160 name_len = strlen(ptr) + 1;
161 if (name_len == 1)
162 {
163 return TRUE;
164 }
165
166 *name = HeapAlloc(GetProcessHeap(), 0, name_len);
167 if (!*name)
168 {
169 ERR("Failed to allocate name memory.\n");
170 return FALSE;
171 }
172
173 memcpy(*name, ptr, name_len);
174
175 return TRUE;
176}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ERR(fmt,...)
Definition: debug.h:110
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
Definition: name.c:39

Referenced by d3dcompiler_parse_rdef(), d3dcompiler_parse_type(), d3dcompiler_parse_type_members(), and d3dcompiler_parse_variables().

◆ copy_value()

static BOOL copy_value ( const char ptr,
void **  value,
DWORD  size 
)
static

Definition at line 178 of file reflection.c.

179{
180 if (!ptr || !size) return TRUE;
181
183 if (!*value)
184 {
185 ERR("Failed to allocate value memory.\n");
186 return FALSE;
187 }
188
189 memcpy(*value, ptr, size);
190
191 return TRUE;
192}
GLsizeiptr size
Definition: glext.h:5919
Definition: pdh_main.c:94

Referenced by d3dcompiler_parse_variables().

◆ d3dcompiler_parse_rdef()

static HRESULT d3dcompiler_parse_rdef ( struct d3dcompiler_shader_reflection r,
const char data,
DWORD  data_size 
)
static

Definition at line 1410 of file reflection.c.

1411{
1412 const char *ptr = data;
1413 DWORD size = data_size >> 2;
1414 DWORD offset, cbuffer_offset, resource_offset, creator_offset;
1415 unsigned int i, string_data_offset, string_data_size;
1416 char *string_data = NULL, *creator = NULL;
1417 D3D11_SHADER_INPUT_BIND_DESC *bound_resources = NULL;
1418 struct d3dcompiler_shader_reflection_constant_buffer *constant_buffers = NULL;
1419 HRESULT hr;
1420
1421 TRACE("Size %u\n", size);
1422
1423 read_dword(&ptr, &r->constant_buffer_count);
1424 TRACE("Constant buffer count: %u\n", r->constant_buffer_count);
1425
1426 read_dword(&ptr, &cbuffer_offset);
1427 TRACE("Constant buffer offset: %#x\n", cbuffer_offset);
1428
1429 read_dword(&ptr, &r->bound_resource_count);
1430 TRACE("Bound resource count: %u\n", r->bound_resource_count);
1431
1432 read_dword(&ptr, &resource_offset);
1433 TRACE("Bound resource offset: %#x\n", resource_offset);
1434
1435 read_dword(&ptr, &r->target);
1436 TRACE("Target: %#x\n", r->target);
1437
1438 read_dword(&ptr, &r->flags);
1439 TRACE("Flags: %u\n", r->flags);
1440
1441 read_dword(&ptr, &creator_offset);
1442 TRACE("Creator at offset %#x.\n", creator_offset);
1443
1444 if (!copy_name(data + creator_offset, &creator))
1445 {
1446 ERR("Failed to copy name.\n");
1447 return E_OUTOFMEMORY;
1448 }
1449 TRACE("Creator: %s.\n", debugstr_a(creator));
1450
1451 /* todo: Parse RD11 */
1452 if ((r->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK) >= 0x500)
1453 {
1455 }
1456
1457 if (r->bound_resource_count)
1458 {
1459 /* 8 for each bind desc */
1460 string_data_offset = resource_offset + r->bound_resource_count * 8 * sizeof(DWORD);
1461 string_data_size = (cbuffer_offset ? cbuffer_offset : creator_offset) - string_data_offset;
1462
1463 string_data = HeapAlloc(GetProcessHeap(), 0, string_data_size);
1464 if (!string_data)
1465 {
1466 ERR("Failed to allocate string data memory.\n");
1467 hr = E_OUTOFMEMORY;
1468 goto err_out;
1469 }
1470 memcpy(string_data, data + string_data_offset, string_data_size);
1471
1472 bound_resources = HeapAlloc(GetProcessHeap(), 0, r->bound_resource_count * sizeof(*bound_resources));
1473 if (!bound_resources)
1474 {
1475 ERR("Failed to allocate resources memory.\n");
1476 hr = E_OUTOFMEMORY;
1477 goto err_out;
1478 }
1479
1480 ptr = data + resource_offset;
1481 for (i = 0; i < r->bound_resource_count; i++)
1482 {
1483 D3D11_SHADER_INPUT_BIND_DESC *desc = &bound_resources[i];
1484
1485 read_dword(&ptr, &offset);
1486 desc->Name = string_data + (offset - string_data_offset);
1487 TRACE("Input bind Name: %s\n", debugstr_a(desc->Name));
1488
1489#ifdef __REACTOS__ /* DWORD* cast added */
1490 read_dword(&ptr, (DWORD*)&desc->Type);
1491#else
1492 read_dword(&ptr, &desc->Type);
1493#endif
1494 TRACE("Input bind Type: %#x\n", desc->Type);
1495
1496#ifdef __REACTOS__ /* DWORD* cast added */
1497 read_dword(&ptr, (DWORD*)&desc->ReturnType);
1498#else
1499 read_dword(&ptr, &desc->ReturnType);
1500#endif
1501 TRACE("Input bind ReturnType: %#x\n", desc->ReturnType);
1502
1503#ifdef __REACTOS__ /* DWORD* cast added */
1504 read_dword(&ptr, (DWORD*)&desc->Dimension);
1505#else
1506 read_dword(&ptr, &desc->Dimension);
1507#endif
1508 TRACE("Input bind Dimension: %#x\n", desc->Dimension);
1509
1510 read_dword(&ptr, &desc->NumSamples);
1511 TRACE("Input bind NumSamples: %u\n", desc->NumSamples);
1512
1513 read_dword(&ptr, &desc->BindPoint);
1514 TRACE("Input bind BindPoint: %u\n", desc->BindPoint);
1515
1516 read_dword(&ptr, &desc->BindCount);
1517 TRACE("Input bind BindCount: %u\n", desc->BindCount);
1518
1519 read_dword(&ptr, &desc->uFlags);
1520 TRACE("Input bind uFlags: %u\n", desc->uFlags);
1521 }
1522 }
1523
1524 if (r->constant_buffer_count)
1525 {
1526 constant_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, r->constant_buffer_count * sizeof(*constant_buffers));
1527 if (!constant_buffers)
1528 {
1529 ERR("Failed to allocate constant buffer memory.\n");
1530 hr = E_OUTOFMEMORY;
1531 goto err_out;
1532 }
1533
1534 ptr = data + cbuffer_offset;
1535 for (i = 0; i < r->constant_buffer_count; i++)
1536 {
1537 struct d3dcompiler_shader_reflection_constant_buffer *cb = &constant_buffers[i];
1538
1539 cb->ID3D11ShaderReflectionConstantBuffer_iface.lpVtbl = &d3dcompiler_shader_reflection_constant_buffer_vtbl;
1540 cb->reflection = r;
1541
1542 read_dword(&ptr, &offset);
1543 if (!copy_name(data + offset, &cb->name))
1544 {
1545 ERR("Failed to copy name.\n");
1546 hr = E_OUTOFMEMORY;
1547 goto err_out;
1548 }
1549 TRACE("Name: %s.\n", debugstr_a(cb->name));
1550
1551 read_dword(&ptr, &cb->variable_count);
1552 TRACE("Variable count: %u\n", cb->variable_count);
1553
1554 read_dword(&ptr, &offset);
1555 TRACE("Variable offset: %x\n", offset);
1556
1557 hr = d3dcompiler_parse_variables(cb, data, data_size, data + offset);
1558 if (hr != S_OK)
1559 {
1560 FIXME("Failed to parse variables.\n");
1561 goto err_out;
1562 }
1563
1564 read_dword(&ptr, &cb->size);
1565 TRACE("Cbuffer size: %u\n", cb->size);
1566
1567 read_dword(&ptr, &cb->flags);
1568 TRACE("Cbuffer flags: %u\n", cb->flags);
1569
1570#ifdef __REACTOS__ /* DWORD* cast added */
1571 read_dword(&ptr, (DWORD*)&cb->type);
1572#else
1573 read_dword(&ptr, &cb->type);
1574#endif
1575 TRACE("Cbuffer type: %#x\n", cb->type);
1576 }
1577 }
1578
1579 r->creator = creator;
1580 r->resource_string = string_data;
1581 r->bound_resources = bound_resources;
1582 r->constant_buffers = constant_buffers;
1583
1584 return S_OK;
1585
1586err_out:
1587 for (i = 0; i < r->constant_buffer_count; ++i)
1588 {
1589 free_constant_buffer(&constant_buffers[i]);
1590 }
1591 HeapFree(GetProcessHeap(), 0, constant_buffers);
1592 HeapFree(GetProcessHeap(), 0, bound_resources);
1593 HeapFree(GetProcessHeap(), 0, string_data);
1594 HeapFree(GetProcessHeap(), 0, creator);
1595
1596 return hr;
1597}
#define FIXME(fmt,...)
Definition: debug.h:111
static void read_dword(const char **ptr, DWORD *d)
void skip_dword_unknown(const char **ptr, unsigned int count) DECLSPEC_HIDDEN
Definition: utils.c:510
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define D3DCOMPILER_SHADER_TARGET_VERSION_MASK
Definition: reflection.c:33
static const struct ID3D11ShaderReflectionConstantBufferVtbl d3dcompiler_shader_reflection_constant_buffer_vtbl
Definition: reflection.c:144
static HRESULT d3dcompiler_parse_variables(struct d3dcompiler_shader_reflection_constant_buffer *cb, const char *data, DWORD data_size, const char *ptr)
Definition: reflection.c:1334
static void free_constant_buffer(struct d3dcompiler_shader_reflection_constant_buffer *cb)
Definition: reflection.c:247
static BOOL copy_name(const char *ptr, char **name)
Definition: reflection.c:154
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLintptr offset
Definition: glext.h:5920
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_OK
Definition: intsafe.h:52
#define debugstr_a
Definition: kernel32.h:31
static const WCHAR desc[]
Definition: protectdata.c:36
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define DWORD
Definition: nt_native.h:44
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by d3dcompiler_shader_reflection_init().

◆ d3dcompiler_parse_shdr()

static HRESULT d3dcompiler_parse_shdr ( struct d3dcompiler_shader_reflection r,
const char data,
DWORD  data_size 
)
static

Definition at line 1717 of file reflection.c.

1718{
1719 const char *ptr = data;
1720
1721 read_dword(&ptr, &r->version);
1722 TRACE("Shader version: %u\n", r->version);
1723
1724 /* todo: Check if anything else is needed from the shdr or shex blob. */
1725
1726 return S_OK;
1727}

Referenced by d3dcompiler_shader_reflection_init().

◆ d3dcompiler_parse_signature()

static HRESULT d3dcompiler_parse_signature ( struct d3dcompiler_shader_signature s,
struct dxbc_section section,
DWORD  target 
)
static

Definition at line 1599 of file reflection.c.

1600{
1602 unsigned int string_data_offset;
1603 unsigned int string_data_size;
1604 const char *ptr = section->data;
1605 char *string_data;
1606 unsigned int i;
1607 DWORD count;
1608 enum D3DCOMPILER_SIGNATURE_ELEMENT_SIZE element_size;
1609
1610 switch (section->tag)
1611 {
1612 case TAG_OSG5:
1614 break;
1615
1616 case TAG_ISGN:
1617 case TAG_OSGN:
1618 case TAG_PCSG:
1620 break;
1621
1622 default:
1623 FIXME("Unhandled section %s!\n", debugstr_an((const char *)&section->tag, 4));
1625 break;
1626 }
1627
1628 read_dword(&ptr, &count);
1629 TRACE("%u elements\n", count);
1630
1632
1633 d = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*d));
1634 if (!d)
1635 {
1636 ERR("Failed to allocate signature memory.\n");
1637 return E_OUTOFMEMORY;
1638 }
1639
1640 /* 2 DWORDs for the header, element_size for each element. */
1641 string_data_offset = 2 * sizeof(DWORD) + count * element_size * sizeof(DWORD);
1642 string_data_size = section->data_size - string_data_offset;
1643
1644 string_data = HeapAlloc(GetProcessHeap(), 0, string_data_size);
1645 if (!string_data)
1646 {
1647 ERR("Failed to allocate string data memory.\n");
1648 HeapFree(GetProcessHeap(), 0, d);
1649 return E_OUTOFMEMORY;
1650 }
1651 memcpy(string_data, section->data + string_data_offset, string_data_size);
1652
1653 for (i = 0; i < count; ++i)
1654 {
1655 UINT name_offset;
1656 DWORD mask;
1657
1658 if (element_size == D3DCOMPILER_SIGNATURE_ELEMENT_SIZE7)
1659 {
1660 read_dword(&ptr, &d[i].Stream);
1661 }
1662 else
1663 {
1664 d[i].Stream = 0;
1665 }
1666
1667 read_dword(&ptr, &name_offset);
1668 d[i].SemanticName = string_data + (name_offset - string_data_offset);
1669 read_dword(&ptr, &d[i].SemanticIndex);
1670#ifdef __REACTOS__ /* DWORD* casts added */
1671 read_dword(&ptr, (DWORD*)&d[i].SystemValueType);
1672 read_dword(&ptr, (DWORD*)&d[i].ComponentType);
1673#else
1674 read_dword(&ptr, &d[i].SystemValueType);
1675 read_dword(&ptr, &d[i].ComponentType);
1676#endif
1677 read_dword(&ptr, &d[i].Register);
1678 read_dword(&ptr, &mask);
1679 d[i].ReadWriteMask = (mask >> 8) & 0xff;
1680 d[i].Mask = mask & 0xff;
1681
1682 /* pixel shaders have a special handling for SystemValueType in the output signature */
1683 if (((target & D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK) == 0xffff0000) && (section->tag == TAG_OSG5 || section->tag == TAG_OSGN))
1684 {
1685 TRACE("Pixelshader output signature fixup.\n");
1686
1687 if (d[i].Register == 0xffffffff)
1688 {
1689 if (!_strnicmp(d[i].SemanticName, "sv_depth", -1))
1690 d[i].SystemValueType = D3D_NAME_DEPTH;
1691 else if (!_strnicmp(d[i].SemanticName, "sv_coverage", -1))
1692 d[i].SystemValueType = D3D_NAME_COVERAGE;
1693 else if (!_strnicmp(d[i].SemanticName, "sv_depthgreaterequal", -1))
1694 d[i].SystemValueType = D3D_NAME_DEPTH_GREATER_EQUAL;
1695 else if (!_strnicmp(d[i].SemanticName, "sv_depthlessequal", -1))
1696 d[i].SystemValueType = D3D_NAME_DEPTH_LESS_EQUAL;
1697 }
1698 else
1699 {
1700 d[i].SystemValueType = D3D_NAME_TARGET;
1701 }
1702 }
1703
1704 TRACE("semantic: %s, semantic idx: %u, sysval_semantic %#x, "
1705 "type %u, register idx: %u, use_mask %#x, input_mask %#x, stream %u\n",
1706 debugstr_a(d[i].SemanticName), d[i].SemanticIndex, d[i].SystemValueType,
1707 d[i].ComponentType, d[i].Register, d[i].Mask, d[i].ReadWriteMask, d[i].Stream);
1708 }
1709
1710 s->elements = d;
1711 s->element_count = count;
1712 s->string_data = string_data;
1713
1714 return S_OK;
1715}
@ D3D_NAME_TARGET
Definition: d3dcommon.idl:611
@ D3D_NAME_DEPTH_GREATER_EQUAL
Definition: d3dcommon.idl:614
@ D3D_NAME_DEPTH_LESS_EQUAL
Definition: d3dcommon.idl:615
@ D3D_NAME_DEPTH
Definition: d3dcommon.idl:612
@ D3D_NAME_COVERAGE
Definition: d3dcommon.idl:613
#define TAG_ISGN
#define TAG_OSGN
#define TAG_OSG5
#define TAG_PCSG
#define D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK
Definition: reflection.c:34
D3DCOMPILER_SIGNATURE_ELEMENT_SIZE
Definition: reflection.c:28
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
#define _strnicmp(_String1, _String2, _MaxCount)
Definition: compat.h:23
unsigned int Mask
Definition: fpcontrol.c:82
GLdouble s
Definition: gl.h:2039
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLint GLuint mask
Definition: glext.h:6028
GLenum target
Definition: glext.h:7315
#define d
Definition: ke_i.h:81
static IStream Stream
Definition: htmldoc.c:1115
unsigned int UINT
Definition: ndis.h:50
Definition: parser.c:56

Referenced by d3dcompiler_shader_reflection_init().

◆ d3dcompiler_parse_stat()

static HRESULT d3dcompiler_parse_stat ( struct d3dcompiler_shader_reflection r,
const char data,
DWORD  data_size 
)
static

Definition at line 1048 of file reflection.c.

1049{
1050 const char *ptr = data;
1051 DWORD size = data_size >> 2;
1052
1053 TRACE("Size %u\n", size);
1054
1055 read_dword(&ptr, &r->instruction_count);
1056 TRACE("InstructionCount: %u\n", r->instruction_count);
1057
1058 read_dword(&ptr, &r->temp_register_count);
1059 TRACE("TempRegisterCount: %u\n", r->temp_register_count);
1060
1062
1063 read_dword(&ptr, &r->dcl_count);
1064 TRACE("DclCount: %u\n", r->dcl_count);
1065
1066 read_dword(&ptr, &r->float_instruction_count);
1067 TRACE("FloatInstructionCount: %u\n", r->float_instruction_count);
1068
1069 read_dword(&ptr, &r->int_instruction_count);
1070 TRACE("IntInstructionCount: %u\n", r->int_instruction_count);
1071
1072 read_dword(&ptr, &r->uint_instruction_count);
1073 TRACE("UintInstructionCount: %u\n", r->uint_instruction_count);
1074
1075 read_dword(&ptr, &r->static_flow_control_count);
1076 TRACE("StaticFlowControlCount: %u\n", r->static_flow_control_count);
1077
1078 read_dword(&ptr, &r->dynamic_flow_control_count);
1079 TRACE("DynamicFlowControlCount: %u\n", r->dynamic_flow_control_count);
1080
1082
1083 read_dword(&ptr, &r->temp_array_count);
1084 TRACE("TempArrayCount: %u\n", r->temp_array_count);
1085
1086 read_dword(&ptr, &r->array_instruction_count);
1087 TRACE("ArrayInstructionCount: %u\n", r->array_instruction_count);
1088
1089 read_dword(&ptr, &r->cut_instruction_count);
1090 TRACE("CutInstructionCount: %u\n", r->cut_instruction_count);
1091
1092 read_dword(&ptr, &r->emit_instruction_count);
1093 TRACE("EmitInstructionCount: %u\n", r->emit_instruction_count);
1094
1095 read_dword(&ptr, &r->texture_normal_instructions);
1096 TRACE("TextureNormalInstructions: %u\n", r->texture_normal_instructions);
1097
1098 read_dword(&ptr, &r->texture_load_instructions);
1099 TRACE("TextureLoadInstructions: %u\n", r->texture_load_instructions);
1100
1101 read_dword(&ptr, &r->texture_comp_instructions);
1102 TRACE("TextureCompInstructions: %u\n", r->texture_comp_instructions);
1103
1104 read_dword(&ptr, &r->texture_bias_instructions);
1105 TRACE("TextureBiasInstructions: %u\n", r->texture_bias_instructions);
1106
1107 read_dword(&ptr, &r->texture_gradient_instructions);
1108 TRACE("TextureGradientInstructions: %u\n", r->texture_gradient_instructions);
1109
1110 read_dword(&ptr, &r->mov_instruction_count);
1111 TRACE("MovInstructionCount: %u\n", r->mov_instruction_count);
1112
1114
1115 read_dword(&ptr, &r->conversion_instruction_count);
1116 TRACE("ConversionInstructionCount: %u\n", r->conversion_instruction_count);
1117
1119
1120#ifdef __REACTOS__ /* DWORD* cast added */
1121 read_dword(&ptr, (DWORD*)&r->input_primitive);
1122#else
1123 read_dword(&ptr, &r->input_primitive);
1124#endif
1125 TRACE("InputPrimitive: %x\n", r->input_primitive);
1126
1127#ifdef __REACTOS__ /* DWORD* cast added */
1128 read_dword(&ptr, (DWORD*)&r->gs_output_topology);
1129#else
1130 read_dword(&ptr, &r->gs_output_topology);
1131#endif
1132 TRACE("GSOutputTopology: %x\n", r->gs_output_topology);
1133
1134 read_dword(&ptr, &r->gs_max_output_vertex_count);
1135 TRACE("GSMaxOutputVertexCount: %u\n", r->gs_max_output_vertex_count);
1136
1138
1139 /* old dx10 stat size */
1140 if (size == 28) return S_OK;
1141
1143
1144 /* dx10 stat size */
1145 if (size == 29) return S_OK;
1146
1148
1149 read_dword(&ptr, &r->c_control_points);
1150 TRACE("cControlPoints: %u\n", r->c_control_points);
1151
1152#ifdef __REACTOS__ /* DWORD* cast added */
1153 read_dword(&ptr, (DWORD*)&r->hs_output_primitive);
1154#else
1155 read_dword(&ptr, &r->hs_output_primitive);
1156#endif
1157 TRACE("HSOutputPrimitive: %x\n", r->hs_output_primitive);
1158
1159#ifdef __REACTOS__ /* DWORD* cast added */
1160 read_dword(&ptr, (DWORD*)&r->hs_prtitioning);
1161#else
1162 read_dword(&ptr, &r->hs_prtitioning);
1163#endif
1164 TRACE("HSPartitioning: %x\n", r->hs_prtitioning);
1165
1166#ifdef __REACTOS__ /* DWORD* cast added */
1167 read_dword(&ptr, (DWORD*)&r->tessellator_domain);
1168#else
1169 read_dword(&ptr, &r->tessellator_domain);
1170#endif
1171 TRACE("TessellatorDomain: %x\n", r->tessellator_domain);
1172
1174
1175 /* dx11 stat size */
1176 if (size == 37) return S_OK;
1177
1178 FIXME("Unhandled size %u\n", size);
1179
1180 return E_FAIL;
1181}
#define E_FAIL
Definition: ddrawi.h:102

Referenced by d3dcompiler_shader_reflection_init().

◆ d3dcompiler_parse_type()

static HRESULT d3dcompiler_parse_type ( struct d3dcompiler_shader_reflection_type type,
const char data,
DWORD  offset 
)
static

Definition at line 1213 of file reflection.c.

1214{
1215 const char *ptr = data + offset;
1216 DWORD temp;
1218 unsigned int i;
1220 HRESULT hr;
1221 DWORD member_offset;
1222
1223 desc = &type->desc;
1224
1225 read_dword(&ptr, &temp);
1226 desc->Class = temp & 0xffff;
1227 desc->Type = temp >> 16;
1228 TRACE("Class %s, Type %s\n", debug_d3dcompiler_shader_variable_class(desc->Class),
1230
1231 read_dword(&ptr, &temp);
1232 desc->Rows = temp & 0xffff;
1233 desc->Columns = temp >> 16;
1234 TRACE("Rows %u, Columns %u\n", desc->Rows, desc->Columns);
1235
1236 read_dword(&ptr, &temp);
1237 desc->Elements = temp & 0xffff;
1238 desc->Members = temp >> 16;
1239 TRACE("Elements %u, Members %u\n", desc->Elements, desc->Members);
1240
1241 read_dword(&ptr, &member_offset);
1242 TRACE("Member Offset %u\n", member_offset);
1243
1244 if ((type->reflection->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK) >= 0x500)
1246
1247 if (desc->Members)
1248 {
1249 const char *ptr2 = data + member_offset;
1250
1251 members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*members) * desc->Members);
1252 if (!members)
1253 {
1254 ERR("Failed to allocate type memory.\n");
1255 return E_OUTOFMEMORY;
1256 }
1257
1258 for (i = 0; i < desc->Members; ++i)
1259 {
1260 hr = d3dcompiler_parse_type_members(type->reflection, &members[i], data, &ptr2);
1261 if (hr != S_OK)
1262 {
1263 FIXME("Failed to parse type members.\n");
1264 goto err_out;
1265 }
1266 }
1267 }
1268
1269 if ((type->reflection->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK) >= 0x500)
1270 {
1271 read_dword(&ptr, &offset);
1272 if (!copy_name(data + offset, &type->name))
1273 {
1274 ERR("Failed to copy name.\n");
1275 heap_free(members);
1276 return E_OUTOFMEMORY;
1277 }
1278 desc->Name = type->name;
1279 TRACE("Type name: %s.\n", debugstr_a(type->name));
1280 }
1281
1282 type->members = members;
1283
1284 return S_OK;
1285
1286err_out:
1287 for (i = 0; i < desc->Members; ++i)
1288 {
1289 free_type_member(&members[i]);
1290 }
1291 HeapFree(GetProcessHeap(), 0, members);
1292 return hr;
1293}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
const char * debug_d3dcompiler_shader_variable_class(D3D_SHADER_VARIABLE_CLASS c) DECLSPEC_HIDDEN
Definition: utils.c:32
const char * debug_d3dcompiler_shader_variable_type(D3D_SHADER_VARIABLE_TYPE t) DECLSPEC_HIDDEN
Definition: utils.c:50
static void free_type_member(struct d3dcompiler_shader_reflection_type_member *member)
Definition: reflection.c:202
static HRESULT d3dcompiler_parse_type_members(struct d3dcompiler_shader_reflection *ref, struct d3dcompiler_shader_reflection_type_member *member, const char *data, const char **ptr)
Definition: reflection.c:1183
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by get_reflection_type().

◆ d3dcompiler_parse_type_members()

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

Definition at line 1183 of file reflection.c.

1185{
1186 DWORD offset;
1187
1189 if (!copy_name(data + offset, &member->name))
1190 {
1191 ERR("Failed to copy name.\n");
1192 return E_OUTOFMEMORY;
1193 }
1194 TRACE("Member name: %s.\n", debugstr_a(member->name));
1195
1197 TRACE("Member type offset: %x\n", offset);
1198
1200 if (!member->type)
1201 {
1202 ERR("Failed to get member type\n");
1204 return E_FAIL;
1205 }
1206
1207 read_dword(ptr, &member->offset);
1208 TRACE("Member offset %x\n", member->offset);
1209
1210 return S_OK;
1211}
static struct d3dcompiler_shader_reflection_type * get_reflection_type(struct d3dcompiler_shader_reflection *reflection, const char *data, DWORD offset)
Definition: reflection.c:1295
char name[MAX_NAME_LEN]
DWORD type
Definition: send.c:48

Referenced by d3dcompiler_parse_type().

◆ d3dcompiler_parse_variables()

static HRESULT d3dcompiler_parse_variables ( struct d3dcompiler_shader_reflection_constant_buffer cb,
const char data,
DWORD  data_size,
const char ptr 
)
static

Definition at line 1334 of file reflection.c.

1336{
1338 unsigned int i;
1339 HRESULT hr;
1340
1341 variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb->variable_count * sizeof(*variables));
1342 if (!variables)
1343 {
1344 ERR("Failed to allocate variables memory.\n");
1345 return E_OUTOFMEMORY;
1346 }
1347
1348 for (i = 0; i < cb->variable_count; i++)
1349 {
1350 struct d3dcompiler_shader_reflection_variable *v = &variables[i];
1351 DWORD offset;
1352
1353 v->ID3D11ShaderReflectionVariable_iface.lpVtbl = &d3dcompiler_shader_reflection_variable_vtbl;
1354 v->constant_buffer = cb;
1355
1356 read_dword(&ptr, &offset);
1357 if (!copy_name(data + offset, &v->name))
1358 {
1359 ERR("Failed to copy name.\n");
1360 hr = E_OUTOFMEMORY;
1361 goto err_out;
1362 }
1363 TRACE("Variable name: %s.\n", debugstr_a(v->name));
1364
1365 read_dword(&ptr, &v->start_offset);
1366 TRACE("Variable offset: %u\n", v->start_offset);
1367
1368 read_dword(&ptr, &v->size);
1369 TRACE("Variable size: %u\n", v->size);
1370
1371 read_dword(&ptr, &v->flags);
1372 TRACE("Variable flags: %u\n", v->flags);
1373
1374 read_dword(&ptr, &offset);
1375 TRACE("Variable type offset: %x\n", offset);
1376 v->type = get_reflection_type(cb->reflection, data, offset);
1377 if (!v->type)
1378 {
1379 ERR("Failed to get type.\n");
1380 hr = E_FAIL;
1381 goto err_out;
1382 }
1383
1384 read_dword(&ptr, &offset);
1385 TRACE("Variable default value offset: %x\n", offset);
1386 if (!copy_value(data + offset, &v->default_value, offset ? v->size : 0))
1387 {
1388 ERR("Failed to copy name.\n");
1389 hr = E_OUTOFMEMORY;
1390 goto err_out;
1391 }
1392
1393 if ((cb->reflection->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK) >= 0x500)
1395 }
1396
1397 cb->variables = variables;
1398
1399 return S_OK;
1400
1401err_out:
1402 for (i = 0; i < cb->variable_count; i++)
1403 {
1404 free_variable(&variables[i]);
1405 }
1406 HeapFree(GetProcessHeap(), 0, variables);
1407 return hr;
1408}
static const struct ID3D11ShaderReflectionVariableVtbl d3dcompiler_shader_reflection_variable_vtbl
Definition: reflection.c:145
static BOOL copy_value(const char *ptr, void **value, DWORD size)
Definition: reflection.c:178
static void free_variable(struct d3dcompiler_shader_reflection_variable *var)
Definition: reflection.c:238
const GLdouble * v
Definition: gl.h:2040

Referenced by d3dcompiler_parse_rdef().

◆ d3dcompiler_shader_reflection_AddRef()

static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_AddRef ( ID3D11ShaderReflection *  iface)
static

Definition at line 327 of file reflection.c.

328{
331
332 TRACE("%p increasing refcount to %u\n", This, refcount);
333
334 return refcount;
335}
#define InterlockedIncrement
Definition: armddk.h:53
static struct d3dcompiler_shader_reflection * impl_from_ID3D11ShaderReflection(ID3D11ShaderReflection *iface)
Definition: reflection.c:304
uint32_t ULONG
Definition: typedefs.h:59

◆ d3dcompiler_shader_reflection_constant_buffer_GetDesc()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetDesc ( ID3D11ShaderReflectionConstantBuffer *  iface,
D3D11_SHADER_BUFFER_DESC desc 
)
static

Definition at line 712 of file reflection.c.

714{
716
717 TRACE("iface %p, desc %p\n", iface, desc);
718
720 {
721 WARN("Null constant buffer specified\n");
722 return E_FAIL;
723 }
724
725 if (!desc)
726 {
727 WARN("Invalid argument specified\n");
728 return E_FAIL;
729 }
730
731 desc->Name = This->name;
732 desc->Type = This->type;
733 desc->Variables = This->variable_count;
734 desc->Size = This->size;
735 desc->uFlags = This->flags;
736
737 return S_OK;
738}
#define WARN(fmt,...)
Definition: debug.h:112
static struct d3dcompiler_shader_reflection_constant_buffer * impl_from_ID3D11ShaderReflectionConstantBuffer(ID3D11ShaderReflectionConstantBuffer *iface)
Definition: reflection.c:707
static struct d3dcompiler_shader_reflection_constant_buffer null_constant_buffer
Definition: reflection.c:149

◆ d3dcompiler_shader_reflection_constant_buffer_GetVariableByIndex()

static ID3D11ShaderReflectionVariable *STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByIndex ( ID3D11ShaderReflectionConstantBuffer *  iface,
UINT  index 
)
static

Definition at line 740 of file reflection.c.

742{
744
745 TRACE("iface %p, index %u\n", iface, index);
746
747 if (index >= This->variable_count)
748 {
749 WARN("Invalid index specified\n");
750 return &null_variable.ID3D11ShaderReflectionVariable_iface;
751 }
752
753 return &This->variables[index].ID3D11ShaderReflectionVariable_iface;
754}
#define index(s, c)
Definition: various.h:29
static struct d3dcompiler_shader_reflection_variable null_variable
Definition: reflection.c:151
GLuint index
Definition: glext.h:6031

◆ d3dcompiler_shader_reflection_constant_buffer_GetVariableByName()

static ID3D11ShaderReflectionVariable *STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByName ( ID3D11ShaderReflectionConstantBuffer *  iface,
const char name 
)
static

Definition at line 756 of file reflection.c.

758{
760 unsigned int i;
761
762 TRACE("iface %p, name %s\n", iface, debugstr_a(name));
763
764 if (!name)
765 {
766 WARN("Invalid argument specified\n");
767 return &null_variable.ID3D11ShaderReflectionVariable_iface;
768 }
769
770 for (i = 0; i < This->variable_count; ++i)
771 {
772 struct d3dcompiler_shader_reflection_variable *v = &This->variables[i];
773
774 if (!strcmp(v->name, name))
775 {
776 TRACE("Returning ID3D11ShaderReflectionVariable %p.\n", v);
777 return &v->ID3D11ShaderReflectionVariable_iface;
778 }
779 }
780
781 WARN("Invalid name specified\n");
782
783 return &null_variable.ID3D11ShaderReflectionVariable_iface;
784}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ d3dcompiler_shader_reflection_GetBitwiseInstructionCount()

static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetBitwiseInstructionCount ( ID3D11ShaderReflection *  iface)
static

Definition at line 621 of file reflection.c.

623{
624 FIXME("iface %p stub!\n", iface);
625
626 return 0;
627}

◆ d3dcompiler_shader_reflection_GetConstantBufferByIndex()

static struct ID3D11ShaderReflectionConstantBuffer *STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByIndex ( ID3D11ShaderReflection *  iface,
UINT  index 
)
static

Definition at line 409 of file reflection.c.

411{
413
414 TRACE("iface %p, index %u\n", iface, index);
415
416 if (index >= This->constant_buffer_count)
417 {
418 WARN("Invalid argument specified\n");
419 return &null_constant_buffer.ID3D11ShaderReflectionConstantBuffer_iface;
420 }
421
422 return &This->constant_buffers[index].ID3D11ShaderReflectionConstantBuffer_iface;
423}

◆ d3dcompiler_shader_reflection_GetConstantBufferByName()

static struct ID3D11ShaderReflectionConstantBuffer *STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByName ( ID3D11ShaderReflection *  iface,
const char name 
)
static

Definition at line 425 of file reflection.c.

427{
429 unsigned int i;
430
431 TRACE("iface %p, name %s\n", iface, debugstr_a(name));
432
433 if (!name)
434 {
435 WARN("Invalid argument specified\n");
436 return &null_constant_buffer.ID3D11ShaderReflectionConstantBuffer_iface;
437 }
438
439 for (i = 0; i < This->constant_buffer_count; ++i)
440 {
441 struct d3dcompiler_shader_reflection_constant_buffer *d = &This->constant_buffers[i];
442
443 if (!strcmp(d->name, name))
444 {
445 TRACE("Returning ID3D11ShaderReflectionConstantBuffer %p.\n", d);
446 return &d->ID3D11ShaderReflectionConstantBuffer_iface;
447 }
448 }
449
450 WARN("Invalid name specified\n");
451
452 return &null_constant_buffer.ID3D11ShaderReflectionConstantBuffer_iface;
453}
char * name
Definition: compiler.c:66

◆ d3dcompiler_shader_reflection_GetConversionInstructionCount()

static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConversionInstructionCount ( ID3D11ShaderReflection *  iface)
static

Definition at line 611 of file reflection.c.

613{
615
616 TRACE("iface %p\n", iface);
617
618 return This->conversion_instruction_count;
619}

◆ d3dcompiler_shader_reflection_GetDesc()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc ( ID3D11ShaderReflection *  iface,
D3D11_SHADER_DESC desc 
)
static

Definition at line 355 of file reflection.c.

356{
358
359 FIXME("iface %p, desc %p partial stub!\n", iface, desc);
360
361 if (!desc)
362 {
363 WARN("Invalid argument specified\n");
364 return E_FAIL;
365 }
366
367 desc->Version = This->version;
368 desc->Creator = This->creator;
369 desc->Flags = This->flags;
370 desc->ConstantBuffers = This->constant_buffer_count;
371 desc->BoundResources = This->bound_resource_count;
372 desc->InputParameters = This->isgn ? This->isgn->element_count : 0;
373 desc->OutputParameters = This->osgn ? This->osgn->element_count : 0;
374 desc->InstructionCount = This->instruction_count;
375 desc->TempRegisterCount = This->temp_register_count;
376 desc->TempArrayCount = This->temp_array_count;
377 desc->DefCount = 0;
378 desc->DclCount = This->dcl_count;
379 desc->TextureNormalInstructions = This->texture_normal_instructions;
380 desc->TextureLoadInstructions = This->texture_load_instructions;
381 desc->TextureCompInstructions = This->texture_comp_instructions;
382 desc->TextureBiasInstructions = This->texture_bias_instructions;
383 desc->TextureGradientInstructions = This->texture_gradient_instructions;
384 desc->FloatInstructionCount = This->float_instruction_count;
385 desc->IntInstructionCount = This->int_instruction_count;
386 desc->UintInstructionCount = This->uint_instruction_count;
387 desc->StaticFlowControlCount = This->static_flow_control_count;
388 desc->DynamicFlowControlCount = This->dynamic_flow_control_count;
389 desc->MacroInstructionCount = 0;
390 desc->ArrayInstructionCount = This->array_instruction_count;
391 desc->CutInstructionCount = This->cut_instruction_count;
392 desc->EmitInstructionCount = This->emit_instruction_count;
393 desc->GSOutputTopology = This->gs_output_topology;
394 desc->GSMaxOutputVertexCount = This->gs_max_output_vertex_count;
395 desc->InputPrimitive = This->input_primitive;
396 desc->PatchConstantParameters = This->pcsg ? This->pcsg->element_count : 0;
397 desc->cGSInstanceCount = 0;
398 desc->cControlPoints = This->c_control_points;
399 desc->HSOutputPrimitive = This->hs_output_primitive;
400 desc->HSPartitioning = This->hs_prtitioning;
401 desc->TessellatorDomain = This->tessellator_domain;
402 desc->cBarrierInstructions = 0;
403 desc->cInterlockedInstructions = 0;
404 desc->cTextureStoreInstructions = 0;
405
406 return S_OK;
407}

◆ d3dcompiler_shader_reflection_GetGSInputPrimitive()

static D3D_PRIMITIVE STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetGSInputPrimitive ( ID3D11ShaderReflection *  iface)
static

Definition at line 629 of file reflection.c.

631{
632 FIXME("iface %p stub!\n", iface);
633
634 return 0;
635}

◆ d3dcompiler_shader_reflection_GetInputParameterDesc()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetInputParameterDesc ( ID3D11ShaderReflection *  iface,
UINT  index,
D3D11_SIGNATURE_PARAMETER_DESC desc 
)
static

Definition at line 473 of file reflection.c.

475{
477
478 TRACE("iface %p, index %u, desc %p\n", iface, index, desc);
479
480 if (!desc || !This->isgn || index >= This->isgn->element_count)
481 {
482 WARN("Invalid argument specified\n");
483 return E_INVALIDARG;
484 }
485
486 *desc = This->isgn->elements[index];
487
488 return S_OK;
489}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ d3dcompiler_shader_reflection_GetMinFeatureLevel()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMinFeatureLevel ( ID3D11ShaderReflection *  iface,
D3D_FEATURE_LEVEL level 
)
static

Definition at line 653 of file reflection.c.

655{
656 FIXME("iface %p, level %p stub!\n", iface, level);
657
658 return E_NOTIMPL;
659}
#define E_NOTIMPL
Definition: ddrawi.h:99
GLint level
Definition: gl.h:1546

◆ d3dcompiler_shader_reflection_GetMovcInstructionCount()

static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovcInstructionCount ( ID3D11ShaderReflection *  iface)
static

Definition at line 603 of file reflection.c.

605{
606 FIXME("iface %p stub!\n", iface);
607
608 return 0;
609}

◆ d3dcompiler_shader_reflection_GetMovInstructionCount()

static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovInstructionCount ( ID3D11ShaderReflection *  iface)
static

Definition at line 593 of file reflection.c.

595{
597
598 TRACE("iface %p\n", iface);
599
600 return This->mov_instruction_count;
601}

◆ d3dcompiler_shader_reflection_GetNumInterfaceSlots()

static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetNumInterfaceSlots ( ID3D11ShaderReflection *  iface)
static

Definition at line 645 of file reflection.c.

647{
648 FIXME("iface %p stub!\n", iface);
649
650 return 0;
651}

◆ d3dcompiler_shader_reflection_GetOutputParameterDesc()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetOutputParameterDesc ( ID3D11ShaderReflection *  iface,
UINT  index,
D3D11_SIGNATURE_PARAMETER_DESC desc 
)
static

Definition at line 491 of file reflection.c.

493{
495
496 TRACE("iface %p, index %u, desc %p\n", iface, index, desc);
497
498 if (!desc || !This->osgn || index >= This->osgn->element_count)
499 {
500 WARN("Invalid argument specified\n");
501 return E_INVALIDARG;
502 }
503
504 *desc = This->osgn->elements[index];
505
506 return S_OK;
507}

◆ d3dcompiler_shader_reflection_GetPatchConstantParameterDesc()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetPatchConstantParameterDesc ( ID3D11ShaderReflection *  iface,
UINT  index,
D3D11_SIGNATURE_PARAMETER_DESC desc 
)
static

Definition at line 509 of file reflection.c.

511{
513
514 TRACE("iface %p, index %u, desc %p\n", iface, index, desc);
515
516 if (!desc || !This->pcsg || index >= This->pcsg->element_count)
517 {
518 WARN("Invalid argument specified\n");
519 return E_INVALIDARG;
520 }
521
522 *desc = This->pcsg->elements[index];
523
524 return S_OK;
525}

◆ d3dcompiler_shader_reflection_GetRequiresFlags()

static UINT64 STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetRequiresFlags ( ID3D11ShaderReflection *  iface)
static

Definition at line 669 of file reflection.c.

671{
672 FIXME("iface %p stub!\n", iface);
673
674 return 0;
675}

◆ d3dcompiler_shader_reflection_GetResourceBindingDesc()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDesc ( ID3D11ShaderReflection *  iface,
UINT  index,
D3D11_SHADER_INPUT_BIND_DESC desc 
)
static

Definition at line 455 of file reflection.c.

457{
459
460 TRACE("iface %p, index %u, desc %p\n", iface, index, desc);
461
462 if (!desc || index >= This->bound_resource_count)
463 {
464 WARN("Invalid argument specified\n");
465 return E_INVALIDARG;
466 }
467
468 *desc = This->bound_resources[index];
469
470 return S_OK;
471}

◆ d3dcompiler_shader_reflection_GetResourceBindingDescByName()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDescByName ( ID3D11ShaderReflection *  iface,
const char name,
D3D11_SHADER_INPUT_BIND_DESC desc 
)
static

Definition at line 562 of file reflection.c.

564{
566 unsigned int i;
567
568 TRACE("iface %p, name %s, desc %p\n", iface, debugstr_a(name), desc);
569
570 if (!desc || !name)
571 {
572 WARN("Invalid argument specified\n");
573 return E_INVALIDARG;
574 }
575
576 for (i = 0; i < This->bound_resource_count; ++i)
577 {
578 D3D11_SHADER_INPUT_BIND_DESC *d = &This->bound_resources[i];
579
580 if (!strcmp(d->Name, name))
581 {
582 TRACE("Returning D3D11_SHADER_INPUT_BIND_DESC %p.\n", d);
583 *desc = *d;
584 return S_OK;
585 }
586 }
587
588 WARN("Invalid name specified\n");
589
590 return E_INVALIDARG;
591}

◆ d3dcompiler_shader_reflection_GetThreadGroupSize()

static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetThreadGroupSize ( ID3D11ShaderReflection *  iface,
UINT sizex,
UINT sizey,
UINT sizez 
)
static

Definition at line 661 of file reflection.c.

663{
664 FIXME("iface %p, sizex %p, sizey %p, sizez %p stub!\n", iface, sizex, sizey, sizez);
665
666 return 0;
667}

◆ d3dcompiler_shader_reflection_GetVariableByName()

static struct ID3D11ShaderReflectionVariable *STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetVariableByName ( ID3D11ShaderReflection *  iface,
const char name 
)
static

Definition at line 527 of file reflection.c.

529{
531 unsigned int i, k;
532
533 TRACE("iface %p, name %s\n", iface, debugstr_a(name));
534
535 if (!name)
536 {
537 WARN("Invalid name specified\n");
538 return &null_variable.ID3D11ShaderReflectionVariable_iface;
539 }
540
541 for (i = 0; i < This->constant_buffer_count; ++i)
542 {
543 struct d3dcompiler_shader_reflection_constant_buffer *cb = &This->constant_buffers[i];
544
545 for (k = 0; k < cb->variable_count; ++k)
546 {
547 struct d3dcompiler_shader_reflection_variable *v = &cb->variables[k];
548
549 if (!strcmp(v->name, name))
550 {
551 TRACE("Returning ID3D11ShaderReflectionVariable %p.\n", v);
552 return &v->ID3D11ShaderReflectionVariable_iface;
553 }
554 }
555 }
556
557 WARN("Invalid name specified\n");
558
559 return &null_variable.ID3D11ShaderReflectionVariable_iface;
560}
int k
Definition: mpi.c:3369

◆ d3dcompiler_shader_reflection_init()

static HRESULT d3dcompiler_shader_reflection_init ( struct d3dcompiler_shader_reflection reflection,
const void data,
SIZE_T  data_size 
)
static

Definition at line 1729 of file reflection.c.

1731{
1732 struct dxbc src_dxbc;
1733 HRESULT hr;
1734 unsigned int i;
1735
1737 reflection->refcount = 1;
1738
1740
1741 hr = dxbc_parse(data, data_size, &src_dxbc);
1742 if (FAILED(hr))
1743 {
1744 WARN("Failed to parse reflection\n");
1745 return hr;
1746 }
1747
1748 for (i = 0; i < src_dxbc.count; ++i)
1749 {
1750 struct dxbc_section *section = &src_dxbc.sections[i];
1751
1752 switch (section->tag)
1753 {
1754 case TAG_RDEF:
1755 hr = d3dcompiler_parse_rdef(reflection, section->data, section->data_size);
1756 if (FAILED(hr))
1757 {
1758 WARN("Failed to parse RDEF section.\n");
1759 goto err_out;
1760 }
1761 break;
1762
1763 case TAG_ISGN:
1764 reflection->isgn = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*reflection->isgn));
1765 if (!reflection->isgn)
1766 {
1767 ERR("Failed to allocate ISGN memory.\n");
1768 hr = E_OUTOFMEMORY;
1769 goto err_out;
1770 }
1771
1772 hr = d3dcompiler_parse_signature(reflection->isgn, section, reflection->target);
1773 if (FAILED(hr))
1774 {
1775 WARN("Failed to parse section ISGN.\n");
1776 goto err_out;
1777 }
1778 break;
1779
1780 case TAG_OSG5:
1781 case TAG_OSGN:
1782 reflection->osgn = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*reflection->osgn));
1783 if (!reflection->osgn)
1784 {
1785 ERR("Failed to allocate OSGN memory.\n");
1786 hr = E_OUTOFMEMORY;
1787 goto err_out;
1788 }
1789
1790 hr = d3dcompiler_parse_signature(reflection->osgn, section, reflection->target);
1791 if (FAILED(hr))
1792 {
1793 WARN("Failed to parse section OSGN.\n");
1794 goto err_out;
1795 }
1796 break;
1797
1798 case TAG_PCSG:
1799 reflection->pcsg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*reflection->pcsg));
1800 if (!reflection->pcsg)
1801 {
1802 ERR("Failed to allocate PCSG memory.\n");
1803 hr = E_OUTOFMEMORY;
1804 goto err_out;
1805 }
1806
1807 hr = d3dcompiler_parse_signature(reflection->pcsg, section, reflection->target);
1808 if (FAILED(hr))
1809 {
1810 WARN("Failed to parse section PCSG.\n");
1811 goto err_out;
1812 }
1813 break;
1814
1815 case TAG_SHEX:
1816 case TAG_SHDR:
1817 hr = d3dcompiler_parse_shdr(reflection, section->data, section->data_size);
1818 if (FAILED(hr))
1819 {
1820 WARN("Failed to parse SHDR section.\n");
1821 goto err_out;
1822 }
1823 break;
1824
1825 case TAG_STAT:
1826 hr = d3dcompiler_parse_stat(reflection, section->data, section->data_size);
1827 if (FAILED(hr))
1828 {
1829 WARN("Failed to parse section STAT.\n");
1830 goto err_out;
1831 }
1832 break;
1833
1834 default:
1835 FIXME("Unhandled section %s!\n", debugstr_an((const char *)&section->tag, 4));
1836 break;
1837 }
1838 }
1839
1840 dxbc_destroy(&src_dxbc);
1841
1842 return hr;
1843
1844err_out:
1845 reflection_cleanup(reflection);
1846 dxbc_destroy(&src_dxbc);
1847
1848 return hr;
1849}
#define TAG_SHEX
#define TAG_SHDR
void dxbc_destroy(struct dxbc *dxbc) DECLSPEC_HIDDEN
Definition: utils.c:648
#define TAG_STAT
HRESULT dxbc_parse(const char *data, SIZE_T data_size, struct dxbc *dxbc) DECLSPEC_HIDDEN
Definition: utils.c:577
#define TAG_RDEF
static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, const char *data, DWORD data_size)
Definition: reflection.c:1410
static const struct ID3D11ShaderReflectionVtbl d3dcompiler_shader_reflection_vtbl
Definition: reflection.c:677
static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *s, struct dxbc_section *section, DWORD target)
Definition: reflection.c:1599
static HRESULT d3dcompiler_parse_shdr(struct d3dcompiler_shader_reflection *r, const char *data, DWORD data_size)
Definition: reflection.c:1717
static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, const char *data, DWORD data_size)
Definition: reflection.c:1048
static int d3dcompiler_shader_reflection_type_compare(const void *key, const struct wine_rb_entry *entry)
Definition: reflection.c:194
static void reflection_cleanup(struct d3dcompiler_shader_reflection *ref)
Definition: reflection.c:263
#define FAILED(hr)
Definition: intsafe.h:51
static void wine_rb_init(struct wine_rb_tree *tree, wine_rb_compare_func_t compare)
Definition: rbtree.h:179
struct d3dcompiler_shader_signature * osgn
Definition: reflection.c:134
struct d3dcompiler_shader_signature * pcsg
Definition: reflection.c:135
ID3D11ShaderReflection ID3D11ShaderReflection_iface
Definition: reflection.c:96
struct d3dcompiler_shader_signature * isgn
Definition: reflection.c:133
struct wine_rb_tree types
Definition: reflection.c:139

Referenced by D3DReflect().

◆ d3dcompiler_shader_reflection_IsSampleFrequencyShader()

static BOOL STDMETHODCALLTYPE d3dcompiler_shader_reflection_IsSampleFrequencyShader ( ID3D11ShaderReflection *  iface)
static

Definition at line 637 of file reflection.c.

639{
640 FIXME("iface %p stub!\n", iface);
641
642 return FALSE;
643}

◆ d3dcompiler_shader_reflection_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_QueryInterface ( ID3D11ShaderReflection *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 309 of file reflection.c.

310{
311 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
312
313 if (IsEqualGUID(riid, &IID_ID3D11ShaderReflection)
315 {
316 IUnknown_AddRef(iface);
317 *object = iface;
318 return S_OK;
319 }
320
321 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
322
323 *object = NULL;
324 return E_NOINTERFACE;
325}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ d3dcompiler_shader_reflection_Release()

static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_Release ( ID3D11ShaderReflection *  iface)
static

Definition at line 337 of file reflection.c.

338{
341
342 TRACE("%p decreasing refcount to %u\n", This, refcount);
343
344 if (!refcount)
345 {
348 }
349
350 return refcount;
351}
#define InterlockedDecrement
Definition: armddk.h:52

◆ d3dcompiler_shader_reflection_type_compare()

static int d3dcompiler_shader_reflection_type_compare ( const void key,
const struct wine_rb_entry entry 
)
static

Definition at line 194 of file reflection.c.

195{
197 const DWORD *id = key;
198
199 return *id - t->id;
200}
GLdouble GLdouble t
Definition: gl.h:2047
uint32_t entry
Definition: isohybrid.c:63
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
Definition: copy.c:22

Referenced by d3dcompiler_shader_reflection_init().

◆ d3dcompiler_shader_reflection_type_destroy()

static void d3dcompiler_shader_reflection_type_destroy ( struct wine_rb_entry entry,
void context 
)
static

Definition at line 210 of file reflection.c.

211{
213 unsigned int i;
214
215 TRACE("reflection type %p.\n", t);
216
217 if (t->members)
218 {
219 for (i = 0; i < t->desc.Members; ++i)
220 {
221 free_type_member(&t->members[i]);
222 }
223 HeapFree(GetProcessHeap(), 0, t->members);
224 }
225
226 heap_free(t->name);
228}

Referenced by reflection_cleanup().

◆ d3dcompiler_shader_reflection_type_GetBaseClass()

static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetBaseClass ( ID3D11ShaderReflectionType *  iface)
static

Definition at line 992 of file reflection.c.

994{
995 FIXME("iface %p stub!\n", iface);
996
997 return NULL;
998}

◆ d3dcompiler_shader_reflection_type_GetDesc()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetDesc ( ID3D11ShaderReflectionType *  iface,
D3D11_SHADER_TYPE_DESC desc 
)
static

Definition at line 873 of file reflection.c.

875{
877
878 TRACE("iface %p, desc %p\n", iface, desc);
879
880 if (This == &null_type)
881 {
882 WARN("Null type specified\n");
883 return E_FAIL;
884 }
885
886 if (!desc)
887 {
888 WARN("Invalid argument specified\n");
889 return E_FAIL;
890 }
891
892 *desc = This->desc;
893
894 return S_OK;
895}
static struct d3dcompiler_shader_reflection_type * impl_from_ID3D11ShaderReflectionType(ID3D11ShaderReflectionType *iface)
Definition: reflection.c:868
static struct d3dcompiler_shader_reflection_type null_type
Definition: reflection.c:150

◆ d3dcompiler_shader_reflection_type_GetInterfaceByIndex()

static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetInterfaceByIndex ( ID3D11ShaderReflectionType *  iface,
UINT  index 
)
static

Definition at line 1008 of file reflection.c.

1010{
1011 FIXME("iface %p, index %u stub!\n", iface, index);
1012
1013 return NULL;
1014}

◆ d3dcompiler_shader_reflection_type_GetMemberTypeByIndex()

static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByIndex ( ID3D11ShaderReflectionType *  iface,
UINT  index 
)
static

Definition at line 897 of file reflection.c.

899{
901
902 TRACE("iface %p, index %u\n", iface, index);
903
904 if (index >= This->desc.Members)
905 {
906 WARN("Invalid index specified\n");
907 return &null_type.ID3D11ShaderReflectionType_iface;
908 }
909
910 return &This->members[index].type->ID3D11ShaderReflectionType_iface;
911}

◆ d3dcompiler_shader_reflection_type_GetMemberTypeByName()

static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByName ( ID3D11ShaderReflectionType *  iface,
const char name 
)
static

Definition at line 913 of file reflection.c.

915{
917 unsigned int i;
918
919 TRACE("iface %p, name %s\n", iface, debugstr_a(name));
920
921 if (!name)
922 {
923 WARN("Invalid argument specified\n");
924 return &null_type.ID3D11ShaderReflectionType_iface;
925 }
926
927 for (i = 0; i < This->desc.Members; ++i)
928 {
930
931 if (!strcmp(member->name, name))
932 {
933 TRACE("Returning ID3D11ShaderReflectionType %p.\n", member->type);
934 return &member->type->ID3D11ShaderReflectionType_iface;
935 }
936 }
937
938 WARN("Invalid name specified\n");
939
940 return &null_type.ID3D11ShaderReflectionType_iface;
941}

◆ d3dcompiler_shader_reflection_type_GetMemberTypeName()

static const char *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeName ( ID3D11ShaderReflectionType *  iface,
UINT  index 
)
static

Definition at line 943 of file reflection.c.

945{
947
948 TRACE("iface %p, index %u\n", iface, index);
949
950 if (This == &null_type)
951 {
952 WARN("Null type specified\n");
953 return "$Invalid";
954 }
955
956 if (index >= This->desc.Members)
957 {
958 WARN("Invalid index specified\n");
959 return NULL;
960 }
961
962 return This->members[index].name;
963}

◆ d3dcompiler_shader_reflection_type_GetNumInterfaces()

static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetNumInterfaces ( ID3D11ShaderReflectionType *  iface)
static

Definition at line 1000 of file reflection.c.

1002{
1003 FIXME("iface %p stub!\n", iface);
1004
1005 return 0;
1006}

◆ d3dcompiler_shader_reflection_type_GetSubType()

static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetSubType ( ID3D11ShaderReflectionType *  iface)
static

Definition at line 984 of file reflection.c.

986{
987 FIXME("iface %p stub!\n", iface);
988
989 return NULL;
990}

◆ d3dcompiler_shader_reflection_type_ImplementsInterface()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_ImplementsInterface ( ID3D11ShaderReflectionType *  iface,
ID3D11ShaderReflectionType *  base 
)
static

Definition at line 1024 of file reflection.c.

1026{
1027 FIXME("iface %p, base %p stub!\n", iface, base);
1028
1029 return E_NOTIMPL;
1030}

◆ d3dcompiler_shader_reflection_type_IsEqual()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsEqual ( ID3D11ShaderReflectionType *  iface,
ID3D11ShaderReflectionType *  type 
)
static

Definition at line 965 of file reflection.c.

967{
969
970 TRACE("iface %p, type %p\n", iface, type);
971
972 if (This == &null_type)
973 {
974 WARN("Null type specified\n");
975 return E_FAIL;
976 }
977
978 if (iface == type)
979 return S_OK;
980
981 return S_FALSE;
982}
#define S_FALSE
Definition: winerror.h:2357

◆ d3dcompiler_shader_reflection_type_IsOfType()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsOfType ( ID3D11ShaderReflectionType *  iface,
ID3D11ShaderReflectionType *  type 
)
static

Definition at line 1016 of file reflection.c.

1018{
1019 FIXME("iface %p, type %p stub!\n", iface, type);
1020
1021 return E_NOTIMPL;
1022}

◆ d3dcompiler_shader_reflection_variable_GetBuffer()

static ID3D11ShaderReflectionConstantBuffer *STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetBuffer ( ID3D11ShaderReflectionVariable *  iface)
static

Definition at line 839 of file reflection.c.

841{
843
844 TRACE("iface %p\n", iface);
845
846 return &This->constant_buffer->ID3D11ShaderReflectionConstantBuffer_iface;
847}
static struct d3dcompiler_shader_reflection_variable * impl_from_ID3D11ShaderReflectionVariable(ID3D11ShaderReflectionVariable *iface)
Definition: reflection.c:796

◆ d3dcompiler_shader_reflection_variable_GetDesc()

static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetDesc ( ID3D11ShaderReflectionVariable *  iface,
D3D11_SHADER_VARIABLE_DESC desc 
)
static

Definition at line 801 of file reflection.c.

803{
805
806 TRACE("iface %p, desc %p\n", iface, desc);
807
808 if (This == &null_variable)
809 {
810 WARN("Null variable specified\n");
811 return E_FAIL;
812 }
813
814 if (!desc)
815 {
816 WARN("Invalid argument specified\n");
817 return E_FAIL;
818 }
819
820 desc->Name = This->name;
821 desc->StartOffset = This->start_offset;
822 desc->Size = This->size;
823 desc->uFlags = This->flags;
824 desc->DefaultValue = This->default_value;
825
826 return S_OK;
827}

◆ d3dcompiler_shader_reflection_variable_GetInterfaceSlot()

static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetInterfaceSlot ( ID3D11ShaderReflectionVariable *  iface,
UINT  index 
)
static

Definition at line 849 of file reflection.c.

851{
852 FIXME("iface %p, index %u stub!\n", iface, index);
853
854 return 0;
855}

◆ d3dcompiler_shader_reflection_variable_GetType()

static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetType ( ID3D11ShaderReflectionVariable *  iface)
static

Definition at line 829 of file reflection.c.

831{
833
834 TRACE("iface %p\n", iface);
835
836 return &This->type->ID3D11ShaderReflectionType_iface;
837}

◆ D3DReflect()

HRESULT WINAPI D3DReflect ( const void data,
SIZE_T  data_size,
REFIID  riid,
void **  reflector 
)

Definition at line 1851 of file reflection.c.

1852{
1854 HRESULT hr;
1855 const DWORD *temp = data;
1856
1857 TRACE("data %p, data_size %lu, riid %s, blob %p\n", data, data_size, debugstr_guid(riid), reflector);
1858
1859 if (!data || data_size < 32)
1860 {
1861 WARN("Invalid argument supplied.\n");
1862 return D3DERR_INVALIDCALL;
1863 }
1864
1865 if (temp[6] != data_size)
1866 {
1867 WARN("Wrong size supplied.\n");
1868 return E_FAIL;
1869 }
1870
1871 if (!IsEqualGUID(riid, &IID_ID3D11ShaderReflection))
1872 {
1873 WARN("Wrong riid %s, accept only %s!\n", debugstr_guid(riid), debugstr_guid(&IID_ID3D11ShaderReflection));
1874 return E_NOINTERFACE;
1875 }
1876
1877 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
1878 if (!object)
1879 return E_OUTOFMEMORY;
1880
1881 hr = d3dcompiler_shader_reflection_init(object, data, data_size);
1882 if (FAILED(hr))
1883 {
1884 WARN("Failed to initialize shader reflection\n");
1885 HeapFree(GetProcessHeap(), 0, object);
1886 return hr;
1887 }
1888
1889 *reflector = object;
1890
1891 TRACE("Created ID3D11ShaderReflection %p\n", object);
1892
1893 return S_OK;
1894}
#define D3DERR_INVALIDCALL
static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_reflection *reflection, const void *data, SIZE_T data_size)
Definition: reflection.c:1729

◆ free_constant_buffer()

static void free_constant_buffer ( struct d3dcompiler_shader_reflection_constant_buffer cb)
static

Definition at line 247 of file reflection.c.

248{
249 if (cb->variables)
250 {
251 unsigned int i;
252
253 for (i = 0; i < cb->variable_count; ++i)
254 {
255 free_variable(&cb->variables[i]);
256 }
257 HeapFree(GetProcessHeap(), 0, cb->variables);
258 }
259
260 HeapFree(GetProcessHeap(), 0, cb->name);
261}

Referenced by d3dcompiler_parse_rdef(), and reflection_cleanup().

◆ free_signature()

static void free_signature ( struct d3dcompiler_shader_signature sig)
static

Definition at line 230 of file reflection.c.

231{
232 TRACE("Free signature %p\n", sig);
233
234 HeapFree(GetProcessHeap(), 0, sig->elements);
236}
D3D11_SIGNATURE_PARAMETER_DESC * elements
Definition: reflection.c:38

Referenced by ITERATE_AppSearch(), ITERATE_CCPSearch(), and reflection_cleanup().

◆ free_type_member()

static void free_type_member ( struct d3dcompiler_shader_reflection_type_member member)
static

Definition at line 202 of file reflection.c.

203{
204 if (member)
205 {
207 }
208}

Referenced by d3dcompiler_parse_type(), and d3dcompiler_shader_reflection_type_destroy().

◆ free_variable()

static void free_variable ( struct d3dcompiler_shader_reflection_variable var)
static

Definition at line 238 of file reflection.c.

239{
240 if (var)
241 {
242 HeapFree(GetProcessHeap(), 0, var->name);
243 HeapFree(GetProcessHeap(), 0, var->default_value);
244 }
245}
const char * var
Definition: shader.c:5666

Referenced by d3dcompiler_parse_variables(), and free_constant_buffer().

◆ get_reflection_type()

static struct d3dcompiler_shader_reflection_type * get_reflection_type ( struct d3dcompiler_shader_reflection reflection,
const char data,
DWORD  offset 
)
static

Definition at line 1295 of file reflection.c.

1296{
1298 struct wine_rb_entry *entry;
1299 HRESULT hr;
1300
1301 entry = wine_rb_get(&reflection->types, &offset);
1302 if (entry)
1303 {
1304 TRACE("Returning existing type.\n");
1306 }
1307
1309 if (!type)
1310 return NULL;
1311
1312 type->ID3D11ShaderReflectionType_iface.lpVtbl = &d3dcompiler_shader_reflection_type_vtbl;
1313 type->id = offset;
1314 type->reflection = reflection;
1315
1317 if (FAILED(hr))
1318 {
1319 ERR("Failed to parse type info, hr %#x.\n", hr);
1321 return NULL;
1322 }
1323
1324 if (wine_rb_put(&reflection->types, &offset, &type->entry) == -1)
1325 {
1326 ERR("Failed to insert type entry.\n");
1328 return NULL;
1329 }
1330
1331 return type;
1332}
static HRESULT d3dcompiler_parse_type(struct d3dcompiler_shader_reflection_type *type, const char *data, DWORD offset)
Definition: reflection.c:1213
static const struct ID3D11ShaderReflectionTypeVtbl d3dcompiler_shader_reflection_type_vtbl
Definition: reflection.c:146
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
Definition: rbtree.h:36

Referenced by d3dcompiler_parse_type_members(), and d3dcompiler_parse_variables().

◆ impl_from_ID3D11ShaderReflection()

◆ impl_from_ID3D11ShaderReflectionConstantBuffer()

static struct d3dcompiler_shader_reflection_constant_buffer * impl_from_ID3D11ShaderReflectionConstantBuffer ( ID3D11ShaderReflectionConstantBuffer *  iface)
inlinestatic

◆ impl_from_ID3D11ShaderReflectionType()

◆ impl_from_ID3D11ShaderReflectionVariable()

static struct d3dcompiler_shader_reflection_variable * impl_from_ID3D11ShaderReflectionVariable ( ID3D11ShaderReflectionVariable *  iface)
inlinestatic

◆ reflection_cleanup()

static void reflection_cleanup ( struct d3dcompiler_shader_reflection ref)
static

Definition at line 263 of file reflection.c.

264{
265 TRACE("Cleanup %p\n", ref);
266
267 if (ref->isgn)
268 {
269 free_signature(ref->isgn);
270 HeapFree(GetProcessHeap(), 0, ref->isgn);
271 }
272
273 if (ref->osgn)
274 {
275 free_signature(ref->osgn);
276 HeapFree(GetProcessHeap(), 0, ref->osgn);
277 }
278
279 if (ref->pcsg)
280 {
281 free_signature(ref->pcsg);
282 HeapFree(GetProcessHeap(), 0, ref->pcsg);
283 }
284
285 if (ref->constant_buffers)
286 {
287 unsigned int i;
288
289 for (i = 0; i < ref->constant_buffer_count; ++i)
290 {
291 free_constant_buffer(&ref->constant_buffers[i]);
292 }
293 }
294
296 HeapFree(GetProcessHeap(), 0, ref->constant_buffers);
297 HeapFree(GetProcessHeap(), 0, ref->bound_resources);
298 HeapFree(GetProcessHeap(), 0, ref->resource_string);
299 HeapFree(GetProcessHeap(), 0, ref->creator);
300}
static void d3dcompiler_shader_reflection_type_destroy(struct wine_rb_entry *entry, void *context)
Definition: reflection.c:210
static void free_signature(struct d3dcompiler_shader_signature *sig)
Definition: reflection.c:230
static void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context)
Definition: rbtree.h:198

Referenced by d3dcompiler_shader_reflection_init(), and d3dcompiler_shader_reflection_Release().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3dcompiler  )

Variable Documentation

◆ d3dcompiler_shader_reflection_constant_buffer_vtbl

static const struct ID3D11ShaderReflectionConstantBufferVtbl d3dcompiler_shader_reflection_constant_buffer_vtbl
static
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetDesc(ID3D11ShaderReflectionConstantBuffer *iface, D3D11_SHADER_BUFFER_DESC *desc)
Definition: reflection.c:712
static ID3D11ShaderReflectionVariable *STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByIndex(ID3D11ShaderReflectionConstantBuffer *iface, UINT index)
Definition: reflection.c:740
static ID3D11ShaderReflectionVariable *STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByName(ID3D11ShaderReflectionConstantBuffer *iface, const char *name)
Definition: reflection.c:756

Definition at line 144 of file reflection.c.

Referenced by d3dcompiler_parse_rdef().

◆ d3dcompiler_shader_reflection_type_vtbl

static const struct ID3D11ShaderReflectionTypeVtbl d3dcompiler_shader_reflection_type_vtbl
static
Initial value:
=
{
}
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetSubType(ID3D11ShaderReflectionType *iface)
Definition: reflection.c:984
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsOfType(ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *type)
Definition: reflection.c:1016
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsEqual(ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *type)
Definition: reflection.c:965
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetBaseClass(ID3D11ShaderReflectionType *iface)
Definition: reflection.c:992
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByIndex(ID3D11ShaderReflectionType *iface, UINT index)
Definition: reflection.c:897
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetDesc(ID3D11ShaderReflectionType *iface, D3D11_SHADER_TYPE_DESC *desc)
Definition: reflection.c:873
static const char *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeName(ID3D11ShaderReflectionType *iface, UINT index)
Definition: reflection.c:943
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByName(ID3D11ShaderReflectionType *iface, const char *name)
Definition: reflection.c:913
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetInterfaceByIndex(ID3D11ShaderReflectionType *iface, UINT index)
Definition: reflection.c:1008
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetNumInterfaces(ID3D11ShaderReflectionType *iface)
Definition: reflection.c:1000
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_ImplementsInterface(ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *base)
Definition: reflection.c:1024

Definition at line 146 of file reflection.c.

Referenced by get_reflection_type().

◆ d3dcompiler_shader_reflection_variable_vtbl

static const struct ID3D11ShaderReflectionVariableVtbl d3dcompiler_shader_reflection_variable_vtbl
static
Initial value:
=
{
}
static ID3D11ShaderReflectionConstantBuffer *STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetBuffer(ID3D11ShaderReflectionVariable *iface)
Definition: reflection.c:839
static ID3D11ShaderReflectionType *STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetType(ID3D11ShaderReflectionVariable *iface)
Definition: reflection.c:829
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetDesc(ID3D11ShaderReflectionVariable *iface, D3D11_SHADER_VARIABLE_DESC *desc)
Definition: reflection.c:801
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetInterfaceSlot(ID3D11ShaderReflectionVariable *iface, UINT index)
Definition: reflection.c:849

Definition at line 145 of file reflection.c.

Referenced by d3dcompiler_parse_variables().

◆ d3dcompiler_shader_reflection_vtbl

const struct ID3D11ShaderReflectionVtbl d3dcompiler_shader_reflection_vtbl
static
Initial value:
=
{
}
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovInstructionCount(ID3D11ShaderReflection *iface)
Definition: reflection.c:593
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovcInstructionCount(ID3D11ShaderReflection *iface)
Definition: reflection.c:603
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetBitwiseInstructionCount(ID3D11ShaderReflection *iface)
Definition: reflection.c:621
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMinFeatureLevel(ID3D11ShaderReflection *iface, D3D_FEATURE_LEVEL *level)
Definition: reflection.c:653
static struct ID3D11ShaderReflectionConstantBuffer *STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByName(ID3D11ShaderReflection *iface, const char *name)
Definition: reflection.c:425
static BOOL STDMETHODCALLTYPE d3dcompiler_shader_reflection_IsSampleFrequencyShader(ID3D11ShaderReflection *iface)
Definition: reflection.c:637
static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_AddRef(ID3D11ShaderReflection *iface)
Definition: reflection.c:327
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDesc(ID3D11ShaderReflection *iface, UINT index, D3D11_SHADER_INPUT_BIND_DESC *desc)
Definition: reflection.c:455
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetInputParameterDesc(ID3D11ShaderReflection *iface, UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
Definition: reflection.c:473
static D3D_PRIMITIVE STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetGSInputPrimitive(ID3D11ShaderReflection *iface)
Definition: reflection.c:629
static UINT64 STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetRequiresFlags(ID3D11ShaderReflection *iface)
Definition: reflection.c:669
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetOutputParameterDesc(ID3D11ShaderReflection *iface, UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
Definition: reflection.c:491
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_QueryInterface(ID3D11ShaderReflection *iface, REFIID riid, void **object)
Definition: reflection.c:309
static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_Release(ID3D11ShaderReflection *iface)
Definition: reflection.c:337
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDescByName(ID3D11ShaderReflection *iface, const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc)
Definition: reflection.c:562
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetNumInterfaceSlots(ID3D11ShaderReflection *iface)
Definition: reflection.c:645
static struct ID3D11ShaderReflectionVariable *STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetVariableByName(ID3D11ShaderReflection *iface, const char *name)
Definition: reflection.c:527
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetThreadGroupSize(ID3D11ShaderReflection *iface, UINT *sizex, UINT *sizey, UINT *sizez)
Definition: reflection.c:661
static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConversionInstructionCount(ID3D11ShaderReflection *iface)
Definition: reflection.c:611
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc(ID3D11ShaderReflection *iface, D3D11_SHADER_DESC *desc)
Definition: reflection.c:355
static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetPatchConstantParameterDesc(ID3D11ShaderReflection *iface, UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
Definition: reflection.c:509
static struct ID3D11ShaderReflectionConstantBuffer *STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByIndex(ID3D11ShaderReflection *iface, UINT index)
Definition: reflection.c:409

Definition at line 677 of file reflection.c.

Referenced by d3dcompiler_shader_reflection_init().

◆ null_constant_buffer

◆ null_type

◆ null_variable