ReactOS 0.4.17-dev-934-g091855f
shader.c File Reference
#include "d3d11_private.h"
#include "winternl.h"
Include dependency graph for shader.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d11)
 
static struct d3d_vertex_shader * impl_from_ID3D11VertexShader (ID3D11VertexShader *iface)
 
static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_QueryInterface (ID3D11VertexShader *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_AddRef (ID3D11VertexShader *iface)
 
static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_Release (ID3D11VertexShader *iface)
 
static void STDMETHODCALLTYPE d3d11_vertex_shader_GetDevice (ID3D11VertexShader *iface, ID3D11Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_GetPrivateData (ID3D11VertexShader *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_SetPrivateData (ID3D11VertexShader *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_SetPrivateDataInterface (ID3D11VertexShader *iface, REFGUID guid, const IUnknown *data)
 
static struct d3d_vertex_shader * impl_from_ID3D10VertexShader (ID3D10VertexShader *iface)
 
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_QueryInterface (ID3D10VertexShader *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_AddRef (ID3D10VertexShader *iface)
 
static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_Release (ID3D10VertexShader *iface)
 
static void STDMETHODCALLTYPE d3d10_vertex_shader_GetDevice (ID3D10VertexShader *iface, ID3D10Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_GetPrivateData (ID3D10VertexShader *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateData (ID3D10VertexShader *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateDataInterface (ID3D10VertexShader *iface, REFGUID guid, const IUnknown *data)
 
static void STDMETHODCALLTYPE d3d_vertex_shader_wined3d_object_destroyed (void *parent)
 
static HRESULT d3d_vertex_shader_init (struct d3d_vertex_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
 
HRESULT d3d_vertex_shader_create (struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, struct d3d_vertex_shader **shader)
 
struct d3d_vertex_shader * unsafe_impl_from_ID3D11VertexShader (ID3D11VertexShader *iface)
 
struct d3d_vertex_shader * unsafe_impl_from_ID3D10VertexShader (ID3D10VertexShader *iface)
 
static struct d3d11_hull_shader * impl_from_ID3D11HullShader (ID3D11HullShader *iface)
 
static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_QueryInterface (ID3D11HullShader *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d11_hull_shader_AddRef (ID3D11HullShader *iface)
 
static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release (ID3D11HullShader *iface)
 
static void STDMETHODCALLTYPE d3d11_hull_shader_GetDevice (ID3D11HullShader *iface, ID3D11Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_GetPrivateData (ID3D11HullShader *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_SetPrivateData (ID3D11HullShader *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_SetPrivateDataInterface (ID3D11HullShader *iface, REFGUID guid, const IUnknown *data)
 
static void STDMETHODCALLTYPE d3d11_hull_shader_wined3d_object_destroyed (void *parent)
 
static HRESULT d3d11_hull_shader_init (struct d3d11_hull_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
 
HRESULT d3d11_hull_shader_create (struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, struct d3d11_hull_shader **shader)
 
struct d3d11_hull_shader * unsafe_impl_from_ID3D11HullShader (ID3D11HullShader *iface)
 
static struct d3d11_domain_shader * impl_from_ID3D11DomainShader (ID3D11DomainShader *iface)
 
static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_QueryInterface (ID3D11DomainShader *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d11_domain_shader_AddRef (ID3D11DomainShader *iface)
 
static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release (ID3D11DomainShader *iface)
 
static void STDMETHODCALLTYPE d3d11_domain_shader_GetDevice (ID3D11DomainShader *iface, ID3D11Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_GetPrivateData (ID3D11DomainShader *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_SetPrivateData (ID3D11DomainShader *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_SetPrivateDataInterface (ID3D11DomainShader *iface, REFGUID guid, const IUnknown *data)
 
static void STDMETHODCALLTYPE d3d11_domain_shader_wined3d_object_destroyed (void *parent)
 
static HRESULT d3d11_domain_shader_init (struct d3d11_domain_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
 
HRESULT d3d11_domain_shader_create (struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, struct d3d11_domain_shader **shader)
 
struct d3d11_domain_shader * unsafe_impl_from_ID3D11DomainShader (ID3D11DomainShader *iface)
 
static struct d3d_geometry_shader * impl_from_ID3D11GeometryShader (ID3D11GeometryShader *iface)
 
static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_QueryInterface (ID3D11GeometryShader *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_AddRef (ID3D11GeometryShader *iface)
 
static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release (ID3D11GeometryShader *iface)
 
static void STDMETHODCALLTYPE d3d11_geometry_shader_GetDevice (ID3D11GeometryShader *iface, ID3D11Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_GetPrivateData (ID3D11GeometryShader *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_SetPrivateData (ID3D11GeometryShader *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_SetPrivateDataInterface (ID3D11GeometryShader *iface, REFGUID guid, const IUnknown *data)
 
static struct d3d_geometry_shader * impl_from_ID3D10GeometryShader (ID3D10GeometryShader *iface)
 
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_QueryInterface (ID3D10GeometryShader *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_AddRef (ID3D10GeometryShader *iface)
 
static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_Release (ID3D10GeometryShader *iface)
 
static void STDMETHODCALLTYPE d3d10_geometry_shader_GetDevice (ID3D10GeometryShader *iface, ID3D10Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_GetPrivateData (ID3D10GeometryShader *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateData (ID3D10GeometryShader *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateDataInterface (ID3D10GeometryShader *iface, REFGUID guid, const IUnknown *data)
 
static void STDMETHODCALLTYPE d3d_geometry_shader_wined3d_object_destroyed (void *parent)
 
static HRESULT validate_stream_output_entries (const D3D11_SO_DECLARATION_ENTRY *entries, unsigned int entry_count, const unsigned int *buffer_strides, unsigned int buffer_stride_count, D3D_FEATURE_LEVEL feature_level)
 
static HRESULT d3d_geometry_shader_init (struct d3d_geometry_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, const D3D11_SO_DECLARATION_ENTRY *so_entries, unsigned int so_entry_count, const unsigned int *buffer_strides, unsigned int buffer_stride_count, unsigned int rasterizer_stream)
 
HRESULT d3d_geometry_shader_create (struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, const D3D11_SO_DECLARATION_ENTRY *so_entries, unsigned int so_entry_count, const unsigned int *buffer_strides, unsigned int buffer_stride_count, unsigned int rasterizer_stream, struct d3d_geometry_shader **shader)
 
struct d3d_geometry_shader * unsafe_impl_from_ID3D11GeometryShader (ID3D11GeometryShader *iface)
 
struct d3d_geometry_shader * unsafe_impl_from_ID3D10GeometryShader (ID3D10GeometryShader *iface)
 
static struct d3d_pixel_shader * impl_from_ID3D11PixelShader (ID3D11PixelShader *iface)
 
static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_QueryInterface (ID3D11PixelShader *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_AddRef (ID3D11PixelShader *iface)
 
static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_Release (ID3D11PixelShader *iface)
 
static void STDMETHODCALLTYPE d3d11_pixel_shader_GetDevice (ID3D11PixelShader *iface, ID3D11Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_GetPrivateData (ID3D11PixelShader *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_SetPrivateData (ID3D11PixelShader *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_SetPrivateDataInterface (ID3D11PixelShader *iface, REFGUID guid, const IUnknown *data)
 
static struct d3d_pixel_shader * impl_from_ID3D10PixelShader (ID3D10PixelShader *iface)
 
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_QueryInterface (ID3D10PixelShader *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_AddRef (ID3D10PixelShader *iface)
 
static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release (ID3D10PixelShader *iface)
 
static void STDMETHODCALLTYPE d3d10_pixel_shader_GetDevice (ID3D10PixelShader *iface, ID3D10Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_GetPrivateData (ID3D10PixelShader *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateData (ID3D10PixelShader *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateDataInterface (ID3D10PixelShader *iface, REFGUID guid, const IUnknown *data)
 
static void STDMETHODCALLTYPE d3d_pixel_shader_wined3d_object_destroyed (void *parent)
 
static HRESULT d3d_pixel_shader_init (struct d3d_pixel_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
 
HRESULT d3d_pixel_shader_create (struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, struct d3d_pixel_shader **shader)
 
struct d3d_pixel_shader * unsafe_impl_from_ID3D11PixelShader (ID3D11PixelShader *iface)
 
struct d3d_pixel_shader * unsafe_impl_from_ID3D10PixelShader (ID3D10PixelShader *iface)
 
static struct d3d11_compute_shader * impl_from_ID3D11ComputeShader (ID3D11ComputeShader *iface)
 
static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_QueryInterface (ID3D11ComputeShader *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d11_compute_shader_AddRef (ID3D11ComputeShader *iface)
 
static ULONG STDMETHODCALLTYPE d3d11_compute_shader_Release (ID3D11ComputeShader *iface)
 
static void STDMETHODCALLTYPE d3d11_compute_shader_GetDevice (ID3D11ComputeShader *iface, ID3D11Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_GetPrivateData (ID3D11ComputeShader *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_SetPrivateData (ID3D11ComputeShader *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_SetPrivateDataInterface (ID3D11ComputeShader *iface, REFGUID guid, const IUnknown *data)
 
static void STDMETHODCALLTYPE d3d11_compute_shader_wined3d_object_destroyed (void *parent)
 
static HRESULT d3d11_compute_shader_init (struct d3d11_compute_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
 
HRESULT d3d11_compute_shader_create (struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, struct d3d11_compute_shader **shader)
 
struct d3d11_compute_shader * unsafe_impl_from_ID3D11ComputeShader (ID3D11ComputeShader *iface)
 
static struct d3d11_class_linkage * impl_from_ID3D11ClassLinkage (ID3D11ClassLinkage *iface)
 
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_QueryInterface (ID3D11ClassLinkage *iface, REFIID riid, void **object)
 
static ULONG STDMETHODCALLTYPE d3d11_class_linkage_AddRef (ID3D11ClassLinkage *iface)
 
static ULONG STDMETHODCALLTYPE d3d11_class_linkage_Release (ID3D11ClassLinkage *iface)
 
static void STDMETHODCALLTYPE d3d11_class_linkage_GetDevice (ID3D11ClassLinkage *iface, ID3D11Device **device)
 
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_GetPrivateData (ID3D11ClassLinkage *iface, REFGUID guid, UINT *data_size, void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_SetPrivateData (ID3D11ClassLinkage *iface, REFGUID guid, UINT data_size, const void *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_SetPrivateDataInterface (ID3D11ClassLinkage *iface, REFGUID guid, const IUnknown *data)
 
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_GetClassInstance (ID3D11ClassLinkage *iface, const char *instance_name, UINT instance_index, ID3D11ClassInstance **class_instance)
 
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_CreateClassInstance (ID3D11ClassLinkage *iface, const char *type_name, UINT cb_offset, UINT cb_vector_offset, UINT texture_offset, UINT sampler_offset, ID3D11ClassInstance **class_instance)
 
HRESULT d3d11_class_linkage_create (struct d3d_device *device, struct d3d11_class_linkage **class_linkage)
 

Variables

static const struct ID3D11VertexShaderVtbl d3d11_vertex_shader_vtbl
 
static const struct ID3D10VertexShaderVtbl d3d10_vertex_shader_vtbl
 
static const struct wined3d_parent_ops d3d_vertex_shader_wined3d_parent_ops
 
static const struct ID3D11HullShaderVtbl d3d11_hull_shader_vtbl
 
static const struct wined3d_parent_ops d3d11_hull_shader_wined3d_parent_ops
 
static const struct ID3D11DomainShaderVtbl d3d11_domain_shader_vtbl
 
static const struct wined3d_parent_ops d3d11_domain_shader_wined3d_parent_ops
 
static const struct ID3D11GeometryShaderVtbl d3d11_geometry_shader_vtbl
 
static const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl
 
static const struct wined3d_parent_ops d3d_geometry_shader_wined3d_parent_ops
 
static const struct ID3D11PixelShaderVtbl d3d11_pixel_shader_vtbl
 
static const struct ID3D10PixelShaderVtbl d3d10_pixel_shader_vtbl
 
static const struct wined3d_parent_ops d3d_pixel_shader_wined3d_parent_ops
 
static const struct ID3D11ComputeShaderVtbl d3d11_compute_shader_vtbl
 
static const struct wined3d_parent_ops d3d11_compute_shader_wined3d_parent_ops
 
static const struct ID3D11ClassLinkageVtbl d3d11_class_linkage_vtbl
 

Function Documentation

◆ d3d10_geometry_shader_AddRef()

static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_AddRef ( ID3D10GeometryShader *  iface)
static

Definition at line 846 of file shader.c.

847{
849
850 TRACE("iface %p.\n", iface);
851
852 return d3d11_geometry_shader_AddRef(&shader->ID3D11GeometryShader_iface);
853}
static struct d3d_geometry_shader * impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface)
Definition: shader.c:829
static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_AddRef(ID3D11GeometryShader *iface)
Definition: shader.c:738
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d10_geometry_shader_GetDevice()

static void STDMETHODCALLTYPE d3d10_geometry_shader_GetDevice ( ID3D10GeometryShader *  iface,
ID3D10Device **  device 
)
static

Definition at line 866 of file shader.c.

867{
869
870 TRACE("iface %p, device %p.\n", iface, device);
871
872 ID3D11Device2_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device);
873}
Definition: devices.h:37

◆ d3d10_geometry_shader_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_GetPrivateData ( ID3D10GeometryShader *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 875 of file shader.c.

877{
879
880 TRACE("iface %p, guid %s, data_size %p, data %p.\n",
881 iface, debugstr_guid(guid), data_size, data);
882
883 return d3d_get_private_data(&shader->private_store, guid, data_size, data);
884}
HRESULT d3d_get_private_data(struct wined3d_private_store *store, REFGUID guid, UINT *data_size, void *data)
Definition: utils.c:803
GUID guid
Definition: version.c:147
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define debugstr_guid
Definition: kernel32.h:35

◆ d3d10_geometry_shader_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_QueryInterface ( ID3D10GeometryShader *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 836 of file shader.c.

838{
840
841 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
842
843 return d3d11_geometry_shader_QueryInterface(&shader->ID3D11GeometryShader_iface, riid, object);
844}
static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_QueryInterface(ID3D11GeometryShader *iface, REFIID riid, void **object)
Definition: shader.c:708
REFIID riid
Definition: atlbase.h:39

◆ d3d10_geometry_shader_Release()

static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_Release ( ID3D10GeometryShader *  iface)
static

Definition at line 855 of file shader.c.

856{
858
859 TRACE("iface %p.\n", iface);
860
861 return d3d11_geometry_shader_Release(&shader->ID3D11GeometryShader_iface);
862}
static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShader *iface)
Definition: shader.c:754

◆ d3d10_geometry_shader_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateData ( ID3D10GeometryShader *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 886 of file shader.c.

888{
890
891 TRACE("iface %p, guid %s, data_size %u, data %p.\n",
892 iface, debugstr_guid(guid), data_size, data);
893
894 return d3d_set_private_data(&shader->private_store, guid, data_size, data);
895}
HRESULT d3d_set_private_data(struct wined3d_private_store *store, REFGUID guid, UINT data_size, const void *data)
Definition: utils.c:841

◆ d3d10_geometry_shader_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateDataInterface ( ID3D10GeometryShader *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 897 of file shader.c.

899{
901
902 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
903
904 return d3d_set_private_data_interface(&shader->private_store, guid, data);
905}
HRESULT d3d_set_private_data_interface(struct wined3d_private_store *store, REFGUID guid, const IUnknown *object)
Definition: utils.c:867

◆ d3d10_pixel_shader_AddRef()

static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_AddRef ( ID3D10PixelShader *  iface)
static

Definition at line 1344 of file shader.c.

1345{
1347
1348 TRACE("iface %p.\n", iface);
1349
1350 return d3d11_pixel_shader_AddRef(&shader->ID3D11PixelShader_iface);
1351}
static struct d3d_pixel_shader * impl_from_ID3D10PixelShader(ID3D10PixelShader *iface)
Definition: shader.c:1327
static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_AddRef(ID3D11PixelShader *iface)
Definition: shader.c:1236

◆ d3d10_pixel_shader_GetDevice()

static void STDMETHODCALLTYPE d3d10_pixel_shader_GetDevice ( ID3D10PixelShader *  iface,
ID3D10Device **  device 
)
static

Definition at line 1364 of file shader.c.

1365{
1367
1368 TRACE("iface %p, device %p.\n", iface, device);
1369
1370 ID3D11Device2_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device);
1371}

◆ d3d10_pixel_shader_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_GetPrivateData ( ID3D10PixelShader *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 1373 of file shader.c.

1375{
1377
1378 TRACE("iface %p, guid %s, data_size %p, data %p.\n",
1379 iface, debugstr_guid(guid), data_size, data);
1380
1381 return d3d_get_private_data(&shader->private_store, guid, data_size, data);
1382}

◆ d3d10_pixel_shader_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_QueryInterface ( ID3D10PixelShader *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 1334 of file shader.c.

1336{
1338
1339 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
1340
1341 return d3d11_pixel_shader_QueryInterface(&shader->ID3D11PixelShader_iface, riid, object);
1342}
static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_QueryInterface(ID3D11PixelShader *iface, REFIID riid, void **object)
Definition: shader.c:1206

◆ d3d10_pixel_shader_Release()

static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release ( ID3D10PixelShader *  iface)
static

Definition at line 1353 of file shader.c.

1354{
1356
1357 TRACE("iface %p.\n", iface);
1358
1359 return d3d11_pixel_shader_Release(&shader->ID3D11PixelShader_iface);
1360}
static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_Release(ID3D11PixelShader *iface)
Definition: shader.c:1252

◆ d3d10_pixel_shader_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateData ( ID3D10PixelShader *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 1384 of file shader.c.

1386{
1388
1389 TRACE("iface %p, guid %s, data_size %u, data %p.\n",
1390 iface, debugstr_guid(guid), data_size, data);
1391
1392 return d3d_set_private_data(&shader->private_store, guid, data_size, data);
1393}

◆ d3d10_pixel_shader_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateDataInterface ( ID3D10PixelShader *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 1395 of file shader.c.

1397{
1399
1400 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
1401
1402 return d3d_set_private_data_interface(&shader->private_store, guid, data);
1403}

◆ d3d10_vertex_shader_AddRef()

static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_AddRef ( ID3D10VertexShader *  iface)
static

Definition at line 171 of file shader.c.

172{
174
175 TRACE("iface %p.\n", iface);
176
177 return d3d11_vertex_shader_AddRef(&shader->ID3D11VertexShader_iface);
178}
static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_AddRef(ID3D11VertexShader *iface)
Definition: shader.c:62
static struct d3d_vertex_shader * impl_from_ID3D10VertexShader(ID3D10VertexShader *iface)
Definition: shader.c:154

◆ d3d10_vertex_shader_GetDevice()

static void STDMETHODCALLTYPE d3d10_vertex_shader_GetDevice ( ID3D10VertexShader *  iface,
ID3D10Device **  device 
)
static

Definition at line 191 of file shader.c.

192{
194
195 TRACE("iface %p, device %p.\n", iface, device);
196
197 ID3D11Device2_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device);
198}

◆ d3d10_vertex_shader_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_GetPrivateData ( ID3D10VertexShader *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 200 of file shader.c.

202{
204
205 TRACE("iface %p, guid %s, data_size %p, data %p.\n",
206 iface, debugstr_guid(guid), data_size, data);
207
208 return d3d_get_private_data(&shader->private_store, guid, data_size, data);
209}

◆ d3d10_vertex_shader_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_QueryInterface ( ID3D10VertexShader *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 161 of file shader.c.

163{
165
166 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
167
168 return d3d11_vertex_shader_QueryInterface(&shader->ID3D11VertexShader_iface, riid, object);
169}
static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_QueryInterface(ID3D11VertexShader *iface, REFIID riid, void **object)
Definition: shader.c:32

◆ d3d10_vertex_shader_Release()

static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_Release ( ID3D10VertexShader *  iface)
static

Definition at line 180 of file shader.c.

181{
183
184 TRACE("iface %p.\n", iface);
185
186 return d3d11_vertex_shader_Release(&shader->ID3D11VertexShader_iface);
187}
static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_Release(ID3D11VertexShader *iface)
Definition: shader.c:78

◆ d3d10_vertex_shader_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateData ( ID3D10VertexShader *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 211 of file shader.c.

213{
215
216 TRACE("iface %p, guid %s, data_size %u, data %p.\n",
217 iface, debugstr_guid(guid), data_size, data);
218
219 return d3d_set_private_data(&shader->private_store, guid, data_size, data);
220}

◆ d3d10_vertex_shader_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateDataInterface ( ID3D10VertexShader *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 222 of file shader.c.

224{
226
227 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
228
229 return d3d_set_private_data_interface(&shader->private_store, guid, data);
230}

◆ d3d11_class_linkage_AddRef()

static ULONG STDMETHODCALLTYPE d3d11_class_linkage_AddRef ( ID3D11ClassLinkage *  iface)
static

Definition at line 1711 of file shader.c.

1712{
1713 struct d3d11_class_linkage *class_linkage = impl_from_ID3D11ClassLinkage(iface);
1714 ULONG refcount = InterlockedIncrement(&class_linkage->refcount);
1715
1716 TRACE("%p increasing refcount to %lu.\n", class_linkage, refcount);
1717
1718 return refcount;
1719}
#define InterlockedIncrement
Definition: armddk.h:53
static struct d3d11_class_linkage * impl_from_ID3D11ClassLinkage(ID3D11ClassLinkage *iface)
Definition: shader.c:1687
uint32_t ULONG
Definition: typedefs.h:59

◆ d3d11_class_linkage_create()

HRESULT d3d11_class_linkage_create ( struct d3d_device *  device,
struct d3d11_class_linkage **  class_linkage 
)

Definition at line 1818 of file shader.c.

1819{
1821
1822 if (!(object = calloc(1, sizeof(*object))))
1823 return E_OUTOFMEMORY;
1824
1825 object->ID3D11ClassLinkage_iface.lpVtbl = &d3d11_class_linkage_vtbl;
1826 object->refcount = 1;
1827 wined3d_private_store_init(&object->private_store);
1828
1829 ID3D11Device2_AddRef(object->device = &device->ID3D11Device2_iface);
1830
1831 TRACE("Created class linkage %p.\n", object);
1832 *class_linkage = object;
1833
1834 return S_OK;
1835}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const struct ID3D11ClassLinkageVtbl d3d11_class_linkage_vtbl
Definition: shader.c:1802
#define S_OK
Definition: intsafe.h:52
#define calloc
Definition: rosglue.h:14
static void wined3d_private_store_init(struct wined3d_private_store *store)
Definition: wined3d.h:2607

Referenced by d3d11_device_CreateClassLinkage().

◆ d3d11_class_linkage_CreateClassInstance()

static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_CreateClassInstance ( ID3D11ClassLinkage *  iface,
const char *  type_name,
UINT  cb_offset,
UINT  cb_vector_offset,
UINT  texture_offset,
UINT  sampler_offset,
ID3D11ClassInstance **  class_instance 
)
static

Definition at line 1790 of file shader.c.

1793{
1794 FIXME("iface %p, type_name %s, cb_offset %u, cb_vector_offset %u, texture_offset %u, "
1795 "sampler_offset %u, class_instance %p stub!\n",
1796 iface, debugstr_a(type_name), cb_offset, cb_vector_offset, texture_offset,
1797 sampler_offset, class_instance);
1798
1799 return E_NOTIMPL;
1800}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
#define debugstr_a
Definition: kernel32.h:31

◆ d3d11_class_linkage_GetClassInstance()

static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_GetClassInstance ( ID3D11ClassLinkage *  iface,
const char *  instance_name,
UINT  instance_index,
ID3D11ClassInstance **  class_instance 
)
static

Definition at line 1781 of file shader.c.

1783{
1784 FIXME("iface %p, instance_name %s, instance_index %u, class_instance %p stub!\n",
1785 iface, debugstr_a(instance_name), instance_index, class_instance);
1786
1787 return E_NOTIMPL;
1788}

◆ d3d11_class_linkage_GetDevice()

static void STDMETHODCALLTYPE d3d11_class_linkage_GetDevice ( ID3D11ClassLinkage *  iface,
ID3D11Device **  device 
)
static

Definition at line 1741 of file shader.c.

1743{
1744 struct d3d11_class_linkage *class_linkage = impl_from_ID3D11ClassLinkage(iface);
1745
1746 TRACE("iface %p, device %p.\n", iface, device);
1747
1748 ID3D11Device_AddRef(*device = (ID3D11Device *)class_linkage->device);
1749}
ID3D11Device2 * device

◆ d3d11_class_linkage_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_GetPrivateData ( ID3D11ClassLinkage *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 1751 of file shader.c.

1753{
1754 struct d3d11_class_linkage *class_linkage = impl_from_ID3D11ClassLinkage(iface);
1755
1756 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
1757
1758 return d3d_get_private_data(&class_linkage->private_store, guid, data_size, data);
1759}
struct wined3d_private_store private_store

◆ d3d11_class_linkage_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_QueryInterface ( ID3D11ClassLinkage *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 1692 of file shader.c.

1694{
1695 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
1696
1697 if (IsEqualGUID(riid, &IID_ID3D11ClassLinkage)
1698 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
1700 {
1701 ID3D11ClassLinkage_AddRef(*object = iface);
1702 return S_OK;
1703 }
1704
1705 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
1706
1707 *object = NULL;
1708 return E_NOINTERFACE;
1709}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
#define NULL
Definition: types.h:112
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ d3d11_class_linkage_Release()

static ULONG STDMETHODCALLTYPE d3d11_class_linkage_Release ( ID3D11ClassLinkage *  iface)
static

Definition at line 1721 of file shader.c.

1722{
1723 struct d3d11_class_linkage *class_linkage = impl_from_ID3D11ClassLinkage(iface);
1724 ULONG refcount = InterlockedDecrement(&class_linkage->refcount);
1725
1726 TRACE("%p decreasing refcount to %lu.\n", class_linkage, refcount);
1727
1728 if (!refcount)
1729 {
1730 ID3D11Device2 *device = class_linkage->device;
1731
1733 free(class_linkage);
1734
1735 ID3D11Device2_Release(device);
1736 }
1737
1738 return refcount;
1739}
#define InterlockedDecrement
Definition: armddk.h:52
#define free
Definition: debug_ros.c:5
static void wined3d_private_store_cleanup(struct wined3d_private_store *store)
Definition: wined3d.h:2636

◆ d3d11_class_linkage_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_SetPrivateData ( ID3D11ClassLinkage *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 1761 of file shader.c.

1763{
1764 struct d3d11_class_linkage *class_linkage = impl_from_ID3D11ClassLinkage(iface);
1765
1766 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
1767
1768 return d3d_set_private_data(&class_linkage->private_store, guid, data_size, data);
1769}

◆ d3d11_class_linkage_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_SetPrivateDataInterface ( ID3D11ClassLinkage *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 1771 of file shader.c.

1773{
1774 struct d3d11_class_linkage *class_linkage = impl_from_ID3D11ClassLinkage(iface);
1775
1776 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
1777
1778 return d3d_set_private_data_interface(&class_linkage->private_store, guid, data);
1779}

◆ d3d11_compute_shader_AddRef()

static ULONG STDMETHODCALLTYPE d3d11_compute_shader_AddRef ( ID3D11ComputeShader *  iface)
static

Definition at line 1526 of file shader.c.

1527{
1530
1531 TRACE("%p increasing refcount to %lu.\n", shader, refcount);
1532
1533 if (refcount == 1)
1534 {
1535 ID3D11Device2_AddRef(shader->device);
1536 wined3d_shader_incref(shader->wined3d_shader);
1537 }
1538
1539 return refcount;
1540}
static struct d3d11_compute_shader * impl_from_ID3D11ComputeShader(ID3D11ComputeShader *iface)
Definition: shader.c:1502
ULONG CDECL wined3d_shader_incref(struct wined3d_shader *shader)
Definition: shader.c:2535

◆ d3d11_compute_shader_create()

HRESULT d3d11_compute_shader_create ( struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length,
struct d3d11_compute_shader **  shader 
)

Definition at line 1655 of file shader.c.

1657{
1659 HRESULT hr;
1660
1661 if (!(object = calloc(1, sizeof(*object))))
1662 return E_OUTOFMEMORY;
1663
1664 if (FAILED(hr = d3d11_compute_shader_init(object, device, byte_code, byte_code_length)))
1665 {
1666 free(object);
1667 return hr;
1668 }
1669
1670 TRACE("Created compute shader %p.\n", object);
1671 *shader = object;
1672
1673 return S_OK;
1674}
HRESULT hr
Definition: delayimp.cpp:582
static HRESULT d3d11_compute_shader_init(struct d3d11_compute_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
Definition: shader.c:1627
#define FAILED(hr)
Definition: intsafe.h:51

Referenced by d3d11_device_CreateComputeShader().

◆ d3d11_compute_shader_GetDevice()

static void STDMETHODCALLTYPE d3d11_compute_shader_GetDevice ( ID3D11ComputeShader *  iface,
ID3D11Device **  device 
)
static

Definition at line 1561 of file shader.c.

1563{
1565
1566 TRACE("iface %p, device %p.\n", iface, device);
1567
1568 ID3D11Device_AddRef(*device = (ID3D11Device *)shader->device);
1569}

◆ d3d11_compute_shader_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_GetPrivateData ( ID3D11ComputeShader *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 1571 of file shader.c.

1573{
1575
1576 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
1577
1578 return d3d_get_private_data(&shader->private_store, guid, data_size, data);
1579}

◆ d3d11_compute_shader_init()

static HRESULT d3d11_compute_shader_init ( struct d3d11_compute_shader *  shader,
struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length 
)
static

Definition at line 1627 of file shader.c.

1629{
1631 HRESULT hr;
1632
1633 shader->ID3D11ComputeShader_iface.lpVtbl = &d3d11_compute_shader_vtbl;
1634 shader->refcount = 1;
1636 wined3d_private_store_init(&shader->private_store);
1637
1638 desc.byte_code = byte_code;
1639 desc.byte_code_size = byte_code_length;
1640 if (FAILED(hr = wined3d_shader_create_cs(device->wined3d_device, &desc, shader,
1642 {
1643 WARN("Failed to create wined3d compute shader, hr %#lx.\n", hr);
1644 wined3d_private_store_cleanup(&shader->private_store);
1646 return E_INVALIDARG;
1647 }
1649
1650 ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
1651
1652 return S_OK;
1653}
#define E_INVALIDARG
Definition: ddrawi.h:101
static const struct wined3d_parent_ops d3d11_compute_shader_wined3d_parent_ops
Definition: shader.c:1622
static const struct ID3D11ComputeShaderVtbl d3d11_compute_shader_vtbl
Definition: shader.c:1601
HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
Definition: shader.c:3176
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
const DWORD * byte_code
Definition: wined3d.h:2105
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:544
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:539

Referenced by d3d11_compute_shader_create().

◆ d3d11_compute_shader_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_QueryInterface ( ID3D11ComputeShader *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 1507 of file shader.c.

1509{
1510 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
1511
1512 if (IsEqualGUID(riid, &IID_ID3D11ComputeShader)
1513 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
1515 {
1516 ID3D11ComputeShader_AddRef(*object = iface);
1517 return S_OK;
1518 }
1519
1520 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
1521
1522 *object = NULL;
1523 return E_NOINTERFACE;
1524}

◆ d3d11_compute_shader_Release()

static ULONG STDMETHODCALLTYPE d3d11_compute_shader_Release ( ID3D11ComputeShader *  iface)
static

Definition at line 1542 of file shader.c.

1543{
1546
1547 TRACE("%p decreasing refcount to %lu.\n", shader, refcount);
1548
1549 if (!refcount)
1550 {
1551 ID3D11Device2 *device = shader->device;
1552 wined3d_shader_decref(shader->wined3d_shader);
1553 /* Release the device last, it may cause the wined3d device to be
1554 * destroyed. */
1555 ID3D11Device2_Release(device);
1556 }
1557
1558 return refcount;
1559}
ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader)
Definition: shader.c:2588

◆ d3d11_compute_shader_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_SetPrivateData ( ID3D11ComputeShader *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 1581 of file shader.c.

1583{
1585
1586 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
1587
1588 return d3d_set_private_data(&shader->private_store, guid, data_size, data);
1589}

◆ d3d11_compute_shader_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_SetPrivateDataInterface ( ID3D11ComputeShader *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 1591 of file shader.c.

1593{
1595
1596 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
1597
1598 return d3d_set_private_data_interface(&shader->private_store, guid, data);
1599}

◆ d3d11_compute_shader_wined3d_object_destroyed()

static void STDMETHODCALLTYPE d3d11_compute_shader_wined3d_object_destroyed ( void *  parent)
static

Definition at line 1614 of file shader.c.

1615{
1617
1618 wined3d_private_store_cleanup(&shader->private_store);
1619 free(parent);
1620}
r parent
Definition: btrfs.c:3010

◆ d3d11_domain_shader_AddRef()

static ULONG STDMETHODCALLTYPE d3d11_domain_shader_AddRef ( ID3D11DomainShader *  iface)
static

Definition at line 541 of file shader.c.

542{
545
546 TRACE("%p increasing refcount to %lu.\n", shader, refcount);
547
548 if (refcount == 1)
549 {
550 ID3D11Device2_AddRef(shader->device);
551 wined3d_shader_incref(shader->wined3d_shader);
552 }
553
554 return refcount;
555}
static struct d3d11_domain_shader * impl_from_ID3D11DomainShader(ID3D11DomainShader *iface)
Definition: shader.c:516

◆ d3d11_domain_shader_create()

HRESULT d3d11_domain_shader_create ( struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length,
struct d3d11_domain_shader **  shader 
)

Definition at line 671 of file shader.c.

673{
675 HRESULT hr;
676
677 if (!(object = calloc(1, sizeof(*object))))
678 return E_OUTOFMEMORY;
679
680 if (FAILED(hr = d3d11_domain_shader_init(object, device, byte_code, byte_code_length)))
681 {
682 free(object);
683 return hr;
684 }
685
686 TRACE("Created domain shader %p.\n", object);
687 *shader = object;
688
689 return S_OK;
690}
static HRESULT d3d11_domain_shader_init(struct d3d11_domain_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
Definition: shader.c:643

Referenced by d3d11_device_CreateDomainShader().

◆ d3d11_domain_shader_GetDevice()

static void STDMETHODCALLTYPE d3d11_domain_shader_GetDevice ( ID3D11DomainShader *  iface,
ID3D11Device **  device 
)
static

Definition at line 576 of file shader.c.

578{
580
581 TRACE("iface %p, device %p.\n", iface, device);
582
583 *device = (ID3D11Device *)shader->device;
584 ID3D11Device_AddRef(*device);
585}

◆ d3d11_domain_shader_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_GetPrivateData ( ID3D11DomainShader *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 587 of file shader.c.

589{
591
592 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
593
594 return d3d_get_private_data(&shader->private_store, guid, data_size, data);
595}

◆ d3d11_domain_shader_init()

static HRESULT d3d11_domain_shader_init ( struct d3d11_domain_shader *  shader,
struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length 
)
static

Definition at line 643 of file shader.c.

645{
647 HRESULT hr;
648
649 shader->ID3D11DomainShader_iface.lpVtbl = &d3d11_domain_shader_vtbl;
650 shader->refcount = 1;
652 wined3d_private_store_init(&shader->private_store);
653
654 desc.byte_code = byte_code;
655 desc.byte_code_size = byte_code_length;
656 if (FAILED(hr = wined3d_shader_create_ds(device->wined3d_device, &desc, shader,
658 {
659 WARN("Failed to create wined3d domain shader, hr %#lx.\n", hr);
660 wined3d_private_store_cleanup(&shader->private_store);
662 return E_INVALIDARG;
663 }
665
666 ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
667
668 return S_OK;
669}
static const struct wined3d_parent_ops d3d11_domain_shader_wined3d_parent_ops
Definition: shader.c:638
static const struct ID3D11DomainShaderVtbl d3d11_domain_shader_vtbl
Definition: shader.c:617
HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
Definition: shader.c:3205

Referenced by d3d11_domain_shader_create().

◆ d3d11_domain_shader_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_QueryInterface ( ID3D11DomainShader *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 521 of file shader.c.

523{
524 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
525
526 if (IsEqualGUID(riid, &IID_ID3D11DomainShader)
527 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
529 {
530 ID3D11DomainShader_AddRef(iface);
531 *object = iface;
532 return S_OK;
533 }
534
535 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
536
537 *object = NULL;
538 return E_NOINTERFACE;
539}

◆ d3d11_domain_shader_Release()

static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release ( ID3D11DomainShader *  iface)
static

Definition at line 557 of file shader.c.

558{
561
562 TRACE("%p decreasing refcount to %lu.\n", shader, refcount);
563
564 if (!refcount)
565 {
566 ID3D11Device2 *device = shader->device;
567 wined3d_shader_decref(shader->wined3d_shader);
568 /* Release the device last, it may cause the wined3d device to be
569 * destroyed. */
570 ID3D11Device2_Release(device);
571 }
572
573 return refcount;
574}

◆ d3d11_domain_shader_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_SetPrivateData ( ID3D11DomainShader *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 597 of file shader.c.

599{
601
602 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
603
604 return d3d_set_private_data(&shader->private_store, guid, data_size, data);
605}

◆ d3d11_domain_shader_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_SetPrivateDataInterface ( ID3D11DomainShader *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 607 of file shader.c.

609{
611
612 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
613
614 return d3d_set_private_data_interface(&shader->private_store, guid, data);
615}

◆ d3d11_domain_shader_wined3d_object_destroyed()

static void STDMETHODCALLTYPE d3d11_domain_shader_wined3d_object_destroyed ( void *  parent)
static

Definition at line 630 of file shader.c.

631{
633
634 wined3d_private_store_cleanup(&shader->private_store);
635 free(parent);
636}

◆ d3d11_geometry_shader_AddRef()

static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_AddRef ( ID3D11GeometryShader *  iface)
static

Definition at line 738 of file shader.c.

739{
742
743 TRACE("%p increasing refcount to %lu.\n", shader, refcount);
744
745 if (refcount == 1)
746 {
747 ID3D11Device2_AddRef(shader->device);
748 wined3d_shader_incref(shader->wined3d_shader);
749 }
750
751 return refcount;
752}
static struct d3d_geometry_shader * impl_from_ID3D11GeometryShader(ID3D11GeometryShader *iface)
Definition: shader.c:703

Referenced by d3d10_geometry_shader_AddRef().

◆ d3d11_geometry_shader_GetDevice()

static void STDMETHODCALLTYPE d3d11_geometry_shader_GetDevice ( ID3D11GeometryShader *  iface,
ID3D11Device **  device 
)
static

Definition at line 773 of file shader.c.

775{
777
778 TRACE("iface %p, device %p.\n", iface, device);
779
780 *device = (ID3D11Device *)shader->device;
781 ID3D11Device_AddRef(*device);
782}

◆ d3d11_geometry_shader_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_GetPrivateData ( ID3D11GeometryShader *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 784 of file shader.c.

786{
788
789 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
790
791 return d3d_get_private_data(&shader->private_store, guid, data_size, data);
792}

◆ d3d11_geometry_shader_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_QueryInterface ( ID3D11GeometryShader *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 708 of file shader.c.

710{
712
713 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
714
715 if (IsEqualGUID(riid, &IID_ID3D11GeometryShader)
716 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
718 {
719 ID3D11GeometryShader_AddRef(iface);
720 *object = iface;
721 return S_OK;
722 }
723
724 if (IsEqualGUID(riid, &IID_ID3D10GeometryShader)
725 || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
726 {
727 ID3D10GeometryShader_AddRef(&shader->ID3D10GeometryShader_iface);
728 *object = &shader->ID3D10GeometryShader_iface;
729 return S_OK;
730 }
731
732 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
733
734 *object = NULL;
735 return E_NOINTERFACE;
736}

Referenced by d3d10_geometry_shader_QueryInterface().

◆ d3d11_geometry_shader_Release()

static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release ( ID3D11GeometryShader *  iface)
static

Definition at line 754 of file shader.c.

755{
758
759 TRACE("%p decreasing refcount to %lu.\n", shader, refcount);
760
761 if (!refcount)
762 {
763 ID3D11Device2 *device = shader->device;
764 wined3d_shader_decref(shader->wined3d_shader);
765 /* Release the device last, it may cause the wined3d device to be
766 * destroyed. */
767 ID3D11Device2_Release(device);
768 }
769
770 return refcount;
771}

Referenced by d3d10_geometry_shader_Release().

◆ d3d11_geometry_shader_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_SetPrivateData ( ID3D11GeometryShader *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 794 of file shader.c.

796{
798
799 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
800
801 return d3d_set_private_data(&shader->private_store, guid, data_size, data);
802}

◆ d3d11_geometry_shader_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_SetPrivateDataInterface ( ID3D11GeometryShader *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 804 of file shader.c.

806{
808
809 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
810
811 return d3d_set_private_data_interface(&shader->private_store, guid, data);
812}

◆ d3d11_hull_shader_AddRef()

static ULONG STDMETHODCALLTYPE d3d11_hull_shader_AddRef ( ID3D11HullShader *  iface)
static

Definition at line 354 of file shader.c.

355{
358
359 TRACE("%p increasing refcount to %lu.\n", shader, refcount);
360
361 if (refcount == 1)
362 {
363 ID3D11Device2_AddRef(shader->device);
364 wined3d_shader_incref(shader->wined3d_shader);
365 }
366
367 return refcount;
368}
static struct d3d11_hull_shader * impl_from_ID3D11HullShader(ID3D11HullShader *iface)
Definition: shader.c:329

◆ d3d11_hull_shader_create()

HRESULT d3d11_hull_shader_create ( struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length,
struct d3d11_hull_shader **  shader 
)

Definition at line 484 of file shader.c.

486{
488 HRESULT hr;
489
490 if (!(object = calloc(1, sizeof(*object))))
491 return E_OUTOFMEMORY;
492
493 if (FAILED(hr = d3d11_hull_shader_init(object, device, byte_code, byte_code_length)))
494 {
495 free(object);
496 return hr;
497 }
498
499 TRACE("Created hull shader %p.\n", object);
500 *shader = object;
501
502 return S_OK;
503}
static HRESULT d3d11_hull_shader_init(struct d3d11_hull_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
Definition: shader.c:456

Referenced by d3d11_device_CreateHullShader().

◆ d3d11_hull_shader_GetDevice()

static void STDMETHODCALLTYPE d3d11_hull_shader_GetDevice ( ID3D11HullShader *  iface,
ID3D11Device **  device 
)
static

Definition at line 389 of file shader.c.

391{
393
394 TRACE("iface %p, device %p.\n", iface, device);
395
396 *device = (ID3D11Device *)shader->device;
397 ID3D11Device_AddRef(*device);
398}

◆ d3d11_hull_shader_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_GetPrivateData ( ID3D11HullShader *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 400 of file shader.c.

402{
404
405 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
406
407 return d3d_get_private_data(&shader->private_store, guid, data_size, data);
408}

◆ d3d11_hull_shader_init()

static HRESULT d3d11_hull_shader_init ( struct d3d11_hull_shader *  shader,
struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length 
)
static

Definition at line 456 of file shader.c.

458{
460 HRESULT hr;
461
462 shader->ID3D11HullShader_iface.lpVtbl = &d3d11_hull_shader_vtbl;
463 shader->refcount = 1;
465 wined3d_private_store_init(&shader->private_store);
466
467 desc.byte_code = byte_code;
468 desc.byte_code_size = byte_code_length;
469 if (FAILED(hr = wined3d_shader_create_hs(device->wined3d_device, &desc, shader,
470 &d3d11_hull_shader_wined3d_parent_ops, &shader->wined3d_shader)))
471 {
472 WARN("Failed to create wined3d hull shader, hr %#lx.\n", hr);
473 wined3d_private_store_cleanup(&shader->private_store);
475 return E_INVALIDARG;
476 }
478
479 ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
480
481 return S_OK;
482}
static const struct ID3D11HullShaderVtbl d3d11_hull_shader_vtbl
Definition: shader.c:430
static const struct wined3d_parent_ops d3d11_hull_shader_wined3d_parent_ops
Definition: shader.c:451
HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
Definition: shader.c:3262

Referenced by d3d11_hull_shader_create().

◆ d3d11_hull_shader_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_QueryInterface ( ID3D11HullShader *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 334 of file shader.c.

336{
337 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
338
339 if (IsEqualGUID(riid, &IID_ID3D11HullShader)
340 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
342 {
343 ID3D11HullShader_AddRef(iface);
344 *object = iface;
345 return S_OK;
346 }
347
348 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
349
350 *object = NULL;
351 return E_NOINTERFACE;
352}

◆ d3d11_hull_shader_Release()

static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release ( ID3D11HullShader *  iface)
static

Definition at line 370 of file shader.c.

371{
374
375 TRACE("%p decreasing refcount to %lu.\n", shader, refcount);
376
377 if (!refcount)
378 {
379 ID3D11Device2 *device = shader->device;
380 wined3d_shader_decref(shader->wined3d_shader);
381 /* Release the device last, it may cause the wined3d device to be
382 * destroyed. */
383 ID3D11Device2_Release(device);
384 }
385
386 return refcount;
387}

◆ d3d11_hull_shader_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_SetPrivateData ( ID3D11HullShader *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 410 of file shader.c.

412{
414
415 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
416
417 return d3d_set_private_data(&shader->private_store, guid, data_size, data);
418}

◆ d3d11_hull_shader_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_SetPrivateDataInterface ( ID3D11HullShader *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 420 of file shader.c.

422{
424
425 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
426
427 return d3d_set_private_data_interface(&shader->private_store, guid, data);
428}

◆ d3d11_hull_shader_wined3d_object_destroyed()

static void STDMETHODCALLTYPE d3d11_hull_shader_wined3d_object_destroyed ( void *  parent)
static

Definition at line 443 of file shader.c.

444{
446
447 wined3d_private_store_cleanup(&shader->private_store);
448 free(parent);
449}

◆ d3d11_pixel_shader_AddRef()

static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_AddRef ( ID3D11PixelShader *  iface)
static

Definition at line 1236 of file shader.c.

1237{
1240
1241 TRACE("%p increasing refcount to %lu.\n", shader, refcount);
1242
1243 if (refcount == 1)
1244 {
1245 ID3D11Device2_AddRef(shader->device);
1246 wined3d_shader_incref(shader->wined3d_shader);
1247 }
1248
1249 return refcount;
1250}
static struct d3d_pixel_shader * impl_from_ID3D11PixelShader(ID3D11PixelShader *iface)
Definition: shader.c:1201

Referenced by d3d10_pixel_shader_AddRef().

◆ d3d11_pixel_shader_GetDevice()

static void STDMETHODCALLTYPE d3d11_pixel_shader_GetDevice ( ID3D11PixelShader *  iface,
ID3D11Device **  device 
)
static

Definition at line 1271 of file shader.c.

1273{
1275
1276 TRACE("iface %p, device %p.\n", iface, device);
1277
1278 *device = (ID3D11Device *)shader->device;
1279 ID3D11Device_AddRef(*device);
1280}

◆ d3d11_pixel_shader_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_GetPrivateData ( ID3D11PixelShader *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 1282 of file shader.c.

1284{
1286
1287 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
1288
1289 return d3d_get_private_data(&shader->private_store, guid, data_size, data);
1290}

◆ d3d11_pixel_shader_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_QueryInterface ( ID3D11PixelShader *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 1206 of file shader.c.

1208{
1210
1211 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
1212
1213 if (IsEqualGUID(riid, &IID_ID3D11PixelShader)
1214 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
1216 {
1217 ID3D11PixelShader_AddRef(iface);
1218 *object = iface;
1219 return S_OK;
1220 }
1221
1222 if (IsEqualGUID(riid, &IID_ID3D10PixelShader)
1223 || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
1224 {
1225 IUnknown_AddRef(&shader->ID3D10PixelShader_iface);
1226 *object = &shader->ID3D10PixelShader_iface;
1227 return S_OK;
1228 }
1229
1230 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
1231
1232 *object = NULL;
1233 return E_NOINTERFACE;
1234}

Referenced by d3d10_pixel_shader_QueryInterface().

◆ d3d11_pixel_shader_Release()

static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_Release ( ID3D11PixelShader *  iface)
static

Definition at line 1252 of file shader.c.

1253{
1256
1257 TRACE("%p decreasing refcount to %lu.\n", shader, refcount);
1258
1259 if (!refcount)
1260 {
1261 ID3D11Device2 *device = shader->device;
1262 wined3d_shader_decref(shader->wined3d_shader);
1263 /* Release the device last, it may cause the wined3d device to be
1264 * destroyed. */
1265 ID3D11Device2_Release(device);
1266 }
1267
1268 return refcount;
1269}

Referenced by d3d10_pixel_shader_Release().

◆ d3d11_pixel_shader_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_SetPrivateData ( ID3D11PixelShader *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 1292 of file shader.c.

1294{
1296
1297 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
1298
1299 return d3d_set_private_data(&shader->private_store, guid, data_size, data);
1300}

◆ d3d11_pixel_shader_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_SetPrivateDataInterface ( ID3D11PixelShader *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 1302 of file shader.c.

1304{
1306
1307 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
1308
1309 return d3d_set_private_data_interface(&shader->private_store, guid, data);
1310}

◆ d3d11_vertex_shader_AddRef()

static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_AddRef ( ID3D11VertexShader *  iface)
static

Definition at line 62 of file shader.c.

63{
66
67 TRACE("%p increasing refcount to %lu.\n", shader, refcount);
68
69 if (refcount == 1)
70 {
71 ID3D11Device2_AddRef(shader->device);
72 wined3d_shader_incref(shader->wined3d_shader);
73 }
74
75 return refcount;
76}
static struct d3d_vertex_shader * impl_from_ID3D11VertexShader(ID3D11VertexShader *iface)
Definition: shader.c:27

Referenced by d3d10_vertex_shader_AddRef().

◆ d3d11_vertex_shader_GetDevice()

static void STDMETHODCALLTYPE d3d11_vertex_shader_GetDevice ( ID3D11VertexShader *  iface,
ID3D11Device **  device 
)
static

Definition at line 98 of file shader.c.

100{
102
103 TRACE("iface %p, device %p.\n", iface, device);
104
105 *device = (ID3D11Device *)shader->device;
106 ID3D11Device_AddRef(*device);
107}

◆ d3d11_vertex_shader_GetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_GetPrivateData ( ID3D11VertexShader *  iface,
REFGUID  guid,
UINT *  data_size,
void *  data 
)
static

Definition at line 109 of file shader.c.

111{
113
114 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
115
116 return d3d_get_private_data(&shader->private_store, guid, data_size, data);
117}

◆ d3d11_vertex_shader_QueryInterface()

static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_QueryInterface ( ID3D11VertexShader *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 32 of file shader.c.

34{
36
37 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
38
39 if (IsEqualGUID(riid, &IID_ID3D11VertexShader)
40 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
42 {
43 ID3D11VertexShader_AddRef(iface);
44 *object = iface;
45 return S_OK;
46 }
47
48 if (IsEqualGUID(riid, &IID_ID3D10VertexShader)
49 || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
50 {
51 IUnknown_AddRef(&shader->ID3D10VertexShader_iface);
52 *object = &shader->ID3D10VertexShader_iface;
53 return S_OK;
54 }
55
56 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
57
58 *object = NULL;
59 return E_NOINTERFACE;
60}

Referenced by d3d10_vertex_shader_QueryInterface().

◆ d3d11_vertex_shader_Release()

static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_Release ( ID3D11VertexShader *  iface)
static

Definition at line 78 of file shader.c.

79{
82
83 TRACE("%p decreasing refcount to %lu.\n", shader, refcount);
84
85 if (!refcount)
86 {
87 ID3D11Device2 *device = shader->device;
88
89 wined3d_shader_decref(shader->wined3d_shader);
90 /* Release the device last, it may cause the wined3d device to be
91 * destroyed. */
92 ID3D11Device2_Release(device);
93 }
94
95 return refcount;
96}

Referenced by d3d10_vertex_shader_Release().

◆ d3d11_vertex_shader_SetPrivateData()

static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_SetPrivateData ( ID3D11VertexShader *  iface,
REFGUID  guid,
UINT  data_size,
const void *  data 
)
static

Definition at line 119 of file shader.c.

121{
123
124 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
125
126 return d3d_set_private_data(&shader->private_store, guid, data_size, data);
127}

◆ d3d11_vertex_shader_SetPrivateDataInterface()

static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_SetPrivateDataInterface ( ID3D11VertexShader *  iface,
REFGUID  guid,
const IUnknown *  data 
)
static

Definition at line 129 of file shader.c.

131{
133
134 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
135
136 return d3d_set_private_data_interface(&shader->private_store, guid, data);
137}

◆ d3d_geometry_shader_create()

HRESULT d3d_geometry_shader_create ( struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length,
const D3D11_SO_DECLARATION_ENTRY *  so_entries,
unsigned int  so_entry_count,
const unsigned int *  buffer_strides,
unsigned int  buffer_stride_count,
unsigned int  rasterizer_stream,
struct d3d_geometry_shader **  shader 
)

Definition at line 1156 of file shader.c.

1160{
1162 HRESULT hr;
1163
1164 if (!(object = calloc(1, sizeof(*object))))
1165 return E_OUTOFMEMORY;
1166
1167 if (FAILED(hr = d3d_geometry_shader_init(object, device, byte_code, byte_code_length,
1168 so_entries, so_entry_count, buffer_strides, buffer_stride_count, rasterizer_stream)))
1169 {
1170 WARN("Failed to initialise geometry shader, hr %#lx.\n", hr);
1171 free(object);
1172 return hr;
1173 }
1174
1175 TRACE("Created geometry shader %p.\n", object);
1176 *shader = object;
1177
1178 return S_OK;
1179}
static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, const D3D11_SO_DECLARATION_ENTRY *so_entries, unsigned int so_entry_count, const unsigned int *buffer_strides, unsigned int buffer_stride_count, unsigned int rasterizer_stream)
Definition: shader.c:1074

Referenced by d3d10_device_CreateGeometryShader(), d3d10_device_CreateGeometryShaderWithStreamOutput(), d3d11_device_CreateGeometryShader(), and d3d11_device_CreateGeometryShaderWithStreamOutput().

◆ d3d_geometry_shader_init()

static HRESULT d3d_geometry_shader_init ( struct d3d_geometry_shader *  shader,
struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length,
const D3D11_SO_DECLARATION_ENTRY *  so_entries,
unsigned int  so_entry_count,
const unsigned int *  buffer_strides,
unsigned int  buffer_stride_count,
unsigned int  rasterizer_stream 
)
static

Definition at line 1074 of file shader.c.

1079{
1080 struct wined3d_stream_output_desc so_desc;
1082 unsigned int i;
1083 HRESULT hr;
1084
1086 {
1087 WARN("Entry count %u is greater than %u.\n",
1089 return E_INVALIDARG;
1090 }
1091 if (so_entries && !so_entry_count)
1092 {
1093 WARN("Invalid SO entry count %u.\n", so_entry_count);
1094 return E_INVALIDARG;
1095 }
1096 if (rasterizer_stream != D3D11_SO_NO_RASTERIZED_STREAM && rasterizer_stream >= D3D11_SO_STREAM_COUNT)
1097 {
1098 WARN("Invalid rasterizer stream %u.\n", rasterizer_stream);
1099 return E_INVALIDARG;
1100 }
1101 if (device->state->feature_level < D3D_FEATURE_LEVEL_11_0)
1102 {
1103 if (rasterizer_stream)
1104 {
1105 WARN("Invalid rasterizer stream %u for feature level %#x.\n",
1106 rasterizer_stream, device->state->feature_level);
1107 return E_INVALIDARG;
1108 }
1109 if (buffer_stride_count && buffer_stride_count != 1)
1110 {
1111 WARN("Invalid buffer stride count %u for feature level %#x.\n",
1112 buffer_stride_count, device->state->feature_level);
1113 return E_INVALIDARG;
1114 }
1115 }
1116
1117 if (FAILED(hr = validate_stream_output_entries(so_entries, so_entry_count,
1118 buffer_strides, buffer_stride_count, device->state->feature_level)))
1119 return hr;
1120
1121 desc.byte_code = byte_code;
1122 desc.byte_code_size = byte_code_length;
1123
1124 memset(&so_desc, 0, sizeof(so_desc));
1125 if (so_entries)
1126 {
1127 so_desc.elements = (const struct wined3d_stream_output_element *)so_entries;
1128 so_desc.element_count = so_entry_count;
1129 for (i = 0; i < min(buffer_stride_count, ARRAY_SIZE(so_desc.buffer_strides)); ++i)
1130 so_desc.buffer_strides[i] = buffer_strides[i];
1131 so_desc.buffer_stride_count = buffer_stride_count;
1132 so_desc.rasterizer_stream_idx = rasterizer_stream;
1133 }
1134
1135 shader->ID3D11GeometryShader_iface.lpVtbl = &d3d11_geometry_shader_vtbl;
1136 shader->ID3D10GeometryShader_iface.lpVtbl = &d3d10_geometry_shader_vtbl;
1137 shader->refcount = 1;
1139 wined3d_private_store_init(&shader->private_store);
1140
1141 if (FAILED(hr = wined3d_shader_create_gs(device->wined3d_device, &desc, so_entries ? &so_desc : NULL,
1143 {
1144 WARN("Failed to create wined3d geometry shader, hr %#lx.\n", hr);
1145 wined3d_private_store_cleanup(&shader->private_store);
1147 return E_INVALIDARG;
1148 }
1150
1151 ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
1152
1153 return S_OK;
1154}
#define ARRAY_SIZE(A)
Definition: main.h:20
const UINT D3D11_SO_NO_RASTERIZED_STREAM
Definition: d3d11.idl:255
const UINT D3D11_SO_STREAM_COUNT
Definition: d3d11.idl:257
const UINT D3D11_SO_OUTPUT_COMPONENT_COUNT
Definition: d3d11.idl:256
@ D3D_FEATURE_LEVEL_11_0
Definition: d3dcommon.idl:109
static const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl
Definition: shader.c:907
static HRESULT validate_stream_output_entries(const D3D11_SO_DECLARATION_ENTRY *entries, unsigned int entry_count, const unsigned int *buffer_strides, unsigned int buffer_stride_count, D3D_FEATURE_LEVEL feature_level)
Definition: shader.c:933
static const struct ID3D11GeometryShaderVtbl d3d11_geometry_shader_vtbl
Definition: shader.c:814
static const struct wined3d_parent_ops d3d_geometry_shader_wined3d_parent_ops
Definition: shader.c:928
HRESULT CDECL wined3d_shader_create_gs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, const struct wined3d_stream_output_desc *so_desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
Definition: shader.c:3234
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 min(a, b)
Definition: monoChain.cc:55
#define memset(x, y, z)
Definition: compat.h:39

Referenced by d3d_geometry_shader_create().

◆ d3d_geometry_shader_wined3d_object_destroyed()

static void STDMETHODCALLTYPE d3d_geometry_shader_wined3d_object_destroyed ( void *  parent)
static

Definition at line 920 of file shader.c.

921{
923
924 wined3d_private_store_cleanup(&shader->private_store);
925 free(parent);
926}

◆ d3d_pixel_shader_create()

HRESULT d3d_pixel_shader_create ( struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length,
struct d3d_pixel_shader **  shader 
)

Definition at line 1460 of file shader.c.

1462{
1463 struct d3d_pixel_shader *object;
1464 HRESULT hr;
1465
1466 if (!(object = calloc(1, sizeof(*object))))
1467 return E_OUTOFMEMORY;
1468
1469 if (FAILED(hr = d3d_pixel_shader_init(object, device, byte_code, byte_code_length)))
1470 {
1471 WARN("Failed to initialise pixel shader, hr %#lx.\n", hr);
1472 free(object);
1473 return hr;
1474 }
1475
1476 TRACE("Created pixel shader %p.\n", object);
1477 *shader = object;
1478
1479 return S_OK;
1480}
static HRESULT d3d_pixel_shader_init(struct d3d_pixel_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
Definition: shader.c:1431

Referenced by d3d10_device_CreatePixelShader(), and d3d11_device_CreatePixelShader().

◆ d3d_pixel_shader_init()

static HRESULT d3d_pixel_shader_init ( struct d3d_pixel_shader *  shader,
struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length 
)
static

Definition at line 1431 of file shader.c.

1433{
1435 HRESULT hr;
1436
1437 shader->ID3D11PixelShader_iface.lpVtbl = &d3d11_pixel_shader_vtbl;
1438 shader->ID3D10PixelShader_iface.lpVtbl = &d3d10_pixel_shader_vtbl;
1439 shader->refcount = 1;
1441 wined3d_private_store_init(&shader->private_store);
1442
1443 desc.byte_code = byte_code;
1444 desc.byte_code_size = byte_code_length;
1445 if (FAILED(hr = wined3d_shader_create_ps(device->wined3d_device, &desc, shader,
1446 &d3d_pixel_shader_wined3d_parent_ops, &shader->wined3d_shader)))
1447 {
1448 WARN("Failed to create wined3d pixel shader, hr %#lx.\n", hr);
1449 wined3d_private_store_cleanup(&shader->private_store);
1451 return E_INVALIDARG;
1452 }
1454
1455 ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
1456
1457 return S_OK;
1458}
static const struct ID3D10PixelShaderVtbl d3d10_pixel_shader_vtbl
Definition: shader.c:1405
static const struct wined3d_parent_ops d3d_pixel_shader_wined3d_parent_ops
Definition: shader.c:1426
static const struct ID3D11PixelShaderVtbl d3d11_pixel_shader_vtbl
Definition: shader.c:1312
HRESULT CDECL wined3d_shader_create_ps(struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
Definition: shader.c:3291

Referenced by d3d_pixel_shader_create().

◆ d3d_pixel_shader_wined3d_object_destroyed()

static void STDMETHODCALLTYPE d3d_pixel_shader_wined3d_object_destroyed ( void *  parent)
static

Definition at line 1418 of file shader.c.

1419{
1420 struct d3d_pixel_shader *shader = parent;
1421
1422 wined3d_private_store_cleanup(&shader->private_store);
1423 free(parent);
1424}

◆ d3d_vertex_shader_create()

HRESULT d3d_vertex_shader_create ( struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length,
struct d3d_vertex_shader **  shader 
)

Definition at line 287 of file shader.c.

289{
291 HRESULT hr;
292
293 if (!(object = calloc(1, sizeof(*object))))
294 return E_OUTOFMEMORY;
295
296 if (FAILED(hr = d3d_vertex_shader_init(object, device, byte_code, byte_code_length)))
297 {
298 WARN("Failed to initialise vertex shader, hr %#lx.\n", hr);
299 free(object);
300 return hr;
301 }
302
303 TRACE("Created vertex shader %p.\n", object);
304 *shader = object;
305
306 return S_OK;
307}
static HRESULT d3d_vertex_shader_init(struct d3d_vertex_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length)
Definition: shader.c:258

Referenced by d3d10_device_CreateVertexShader(), and d3d11_device_CreateVertexShader().

◆ d3d_vertex_shader_init()

static HRESULT d3d_vertex_shader_init ( struct d3d_vertex_shader *  shader,
struct d3d_device *  device,
const void *  byte_code,
SIZE_T  byte_code_length 
)
static

Definition at line 258 of file shader.c.

260{
262 HRESULT hr;
263
264 shader->ID3D11VertexShader_iface.lpVtbl = &d3d11_vertex_shader_vtbl;
265 shader->ID3D10VertexShader_iface.lpVtbl = &d3d10_vertex_shader_vtbl;
266 shader->refcount = 1;
268 wined3d_private_store_init(&shader->private_store);
269
270 desc.byte_code = byte_code;
271 desc.byte_code_size = byte_code_length;
272 if (FAILED(hr = wined3d_shader_create_vs(device->wined3d_device, &desc, shader,
273 &d3d_vertex_shader_wined3d_parent_ops, &shader->wined3d_shader)))
274 {
275 WARN("Failed to create wined3d vertex shader, hr %#lx.\n", hr);
276 wined3d_private_store_cleanup(&shader->private_store);
278 return E_INVALIDARG;
279 }
281
282 ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
283
284 return S_OK;
285}
static const struct ID3D10VertexShaderVtbl d3d10_vertex_shader_vtbl
Definition: shader.c:232
static const struct wined3d_parent_ops d3d_vertex_shader_wined3d_parent_ops
Definition: shader.c:253
static const struct ID3D11VertexShaderVtbl d3d11_vertex_shader_vtbl
Definition: shader.c:139
HRESULT CDECL wined3d_shader_create_vs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
Definition: shader.c:3318

Referenced by d3d_vertex_shader_create().

◆ d3d_vertex_shader_wined3d_object_destroyed()

static void STDMETHODCALLTYPE d3d_vertex_shader_wined3d_object_destroyed ( void *  parent)
static

Definition at line 245 of file shader.c.

246{
248
249 wined3d_private_store_cleanup(&shader->private_store);
250 free(parent);
251}

◆ impl_from_ID3D10GeometryShader()

◆ impl_from_ID3D10PixelShader()

◆ impl_from_ID3D10VertexShader()

◆ impl_from_ID3D11ClassLinkage()

static struct d3d11_class_linkage * impl_from_ID3D11ClassLinkage ( ID3D11ClassLinkage *  iface)
inlinestatic

◆ impl_from_ID3D11ComputeShader()

static struct d3d11_compute_shader * impl_from_ID3D11ComputeShader ( ID3D11ComputeShader *  iface)
inlinestatic

◆ impl_from_ID3D11DomainShader()

static struct d3d11_domain_shader * impl_from_ID3D11DomainShader ( ID3D11DomainShader *  iface)
inlinestatic

◆ impl_from_ID3D11GeometryShader()

◆ impl_from_ID3D11HullShader()

static struct d3d11_hull_shader * impl_from_ID3D11HullShader ( ID3D11HullShader *  iface)
inlinestatic

◆ impl_from_ID3D11PixelShader()

◆ impl_from_ID3D11VertexShader()

◆ unsafe_impl_from_ID3D10GeometryShader()

struct d3d_geometry_shader * unsafe_impl_from_ID3D10GeometryShader ( ID3D10GeometryShader *  iface)

Definition at line 1190 of file shader.c.

1191{
1192 if (!iface)
1193 return NULL;
1194 assert(iface->lpVtbl == &d3d10_geometry_shader_vtbl);
1195
1196 return impl_from_ID3D10GeometryShader(iface);
1197}
#define assert(_expr)
Definition: assert.h:32

Referenced by d3d10_device_GSSetShader().

◆ unsafe_impl_from_ID3D10PixelShader()

struct d3d_pixel_shader * unsafe_impl_from_ID3D10PixelShader ( ID3D10PixelShader *  iface)

Definition at line 1491 of file shader.c.

1492{
1493 if (!iface)
1494 return NULL;
1495 assert(iface->lpVtbl == &d3d10_pixel_shader_vtbl);
1496
1497 return impl_from_ID3D10PixelShader(iface);
1498}

Referenced by d3d10_device_PSSetShader().

◆ unsafe_impl_from_ID3D10VertexShader()

struct d3d_vertex_shader * unsafe_impl_from_ID3D10VertexShader ( ID3D10VertexShader *  iface)

Definition at line 318 of file shader.c.

319{
320 if (!iface)
321 return NULL;
322 assert(iface->lpVtbl == &d3d10_vertex_shader_vtbl);
323
324 return impl_from_ID3D10VertexShader(iface);
325}

Referenced by d3d10_device_VSSetShader().

◆ unsafe_impl_from_ID3D11ComputeShader()

struct d3d11_compute_shader * unsafe_impl_from_ID3D11ComputeShader ( ID3D11ComputeShader *  iface)

Definition at line 1676 of file shader.c.

1677{
1678 if (!iface)
1679 return NULL;
1680 assert(iface->lpVtbl == &d3d11_compute_shader_vtbl);
1681
1682 return impl_from_ID3D11ComputeShader(iface);
1683}

Referenced by d3d11_device_context_CSSetShader().

◆ unsafe_impl_from_ID3D11DomainShader()

struct d3d11_domain_shader * unsafe_impl_from_ID3D11DomainShader ( ID3D11DomainShader *  iface)

Definition at line 692 of file shader.c.

693{
694 if (!iface)
695 return NULL;
696 assert(iface->lpVtbl == &d3d11_domain_shader_vtbl);
697
698 return impl_from_ID3D11DomainShader(iface);
699}

Referenced by d3d11_device_context_DSSetShader().

◆ unsafe_impl_from_ID3D11GeometryShader()

struct d3d_geometry_shader * unsafe_impl_from_ID3D11GeometryShader ( ID3D11GeometryShader *  iface)

Definition at line 1181 of file shader.c.

1182{
1183 if (!iface)
1184 return NULL;
1185 assert(iface->lpVtbl == &d3d11_geometry_shader_vtbl);
1186
1187 return impl_from_ID3D11GeometryShader(iface);
1188}

Referenced by d3d11_device_context_GSSetShader().

◆ unsafe_impl_from_ID3D11HullShader()

struct d3d11_hull_shader * unsafe_impl_from_ID3D11HullShader ( ID3D11HullShader *  iface)

Definition at line 505 of file shader.c.

506{
507 if (!iface)
508 return NULL;
509 assert(iface->lpVtbl == &d3d11_hull_shader_vtbl);
510
511 return impl_from_ID3D11HullShader(iface);
512}

Referenced by d3d11_device_context_HSSetShader().

◆ unsafe_impl_from_ID3D11PixelShader()

struct d3d_pixel_shader * unsafe_impl_from_ID3D11PixelShader ( ID3D11PixelShader *  iface)

Definition at line 1482 of file shader.c.

1483{
1484 if (!iface)
1485 return NULL;
1486 assert(iface->lpVtbl == &d3d11_pixel_shader_vtbl);
1487
1488 return impl_from_ID3D11PixelShader(iface);
1489}

Referenced by d3d11_device_context_PSSetShader().

◆ unsafe_impl_from_ID3D11VertexShader()

struct d3d_vertex_shader * unsafe_impl_from_ID3D11VertexShader ( ID3D11VertexShader *  iface)

Definition at line 309 of file shader.c.

310{
311 if (!iface)
312 return NULL;
313 assert(iface->lpVtbl == &d3d11_vertex_shader_vtbl);
314
315 return impl_from_ID3D11VertexShader(iface);
316}

Referenced by d3d11_device_context_VSSetShader().

◆ validate_stream_output_entries()

static HRESULT validate_stream_output_entries ( const D3D11_SO_DECLARATION_ENTRY *  entries,
unsigned int  entry_count,
const unsigned int *  buffer_strides,
unsigned int  buffer_stride_count,
D3D_FEATURE_LEVEL  feature_level 
)
static

Definition at line 933 of file shader.c.

935{
936 unsigned int i, j;
937
938 for (i = 0; i < entry_count; ++i)
939 {
940 const D3D11_SO_DECLARATION_ENTRY *e = &entries[i];
941
942 TRACE("Stream: %u, semantic: %s, semantic idx: %u, start component: %u, "
943 "component count %u, output slot %u.\n",
944 e->Stream, debugstr_a(e->SemanticName), e->SemanticIndex,
945 e->StartComponent, e->ComponentCount, e->OutputSlot);
946
947 if (e->Stream >= D3D11_SO_STREAM_COUNT)
948 {
949 WARN("Invalid stream %u.\n", e->Stream);
950 return E_INVALIDARG;
951 }
952 if (e->Stream && feature_level < D3D_FEATURE_LEVEL_11_0)
953 {
954 WARN("Invalid stream %u for feature level %#x.\n", e->Stream, feature_level);
955 return E_INVALIDARG;
956 }
957 if (e->Stream)
958 {
959 FIXME("Streams not implemented yet.\n");
960 return E_INVALIDARG;
961 }
962 if (e->OutputSlot >= D3D11_SO_BUFFER_SLOT_COUNT)
963 {
964 WARN("Invalid output slot %u.\n", e->OutputSlot);
965 return E_INVALIDARG;
966 }
967
968 if (!e->SemanticName)
969 {
970 if (e->SemanticIndex)
971 {
972 WARN("Invalid semantic idx %u for stream output gap.\n", e->SemanticIndex);
973 return E_INVALIDARG;
974 }
975 if (e->StartComponent || !e->ComponentCount)
976 {
977 WARN("Invalid stream output gap %u-%u.\n", e->StartComponent, e->ComponentCount);
978 return E_INVALIDARG;
979 }
980 }
981 else
982 {
983 if (e->StartComponent > 3 || e->ComponentCount > 4 || !e->ComponentCount
984 || e->StartComponent + e->ComponentCount > 4)
985 {
986 WARN("Invalid component range %u-%u.\n", e->StartComponent, e->ComponentCount);
987 return E_INVALIDARG;
988 }
989 }
990 }
991
992 for (i = 0; i < entry_count; ++i)
993 {
994 const D3D11_SO_DECLARATION_ENTRY *e1 = &entries[i];
995 if (!e1->SemanticName) /* gap */
996 continue;
997
998 for (j = i + 1; j < entry_count; ++j)
999 {
1000 const D3D11_SO_DECLARATION_ENTRY *e2 = &entries[j];
1001 if (!e2->SemanticName) /* gap */
1002 continue;
1003
1004 if (e1->Stream == e2->Stream
1005 && !stricmp(e1->SemanticName, e2->SemanticName)
1006 && e1->SemanticIndex == e2->SemanticIndex
1007 && e1->StartComponent < e2->StartComponent + e2->ComponentCount
1008 && e1->StartComponent + e1->ComponentCount > e2->StartComponent)
1009 {
1010 WARN("Stream output elements %u and %u overlap.\n", i, j);
1011 return E_INVALIDARG;
1012 }
1013 }
1014 }
1015
1016 for (i = 0; i < D3D11_SO_STREAM_COUNT; ++i)
1017 {
1018 unsigned int current_stride[D3D11_SO_BUFFER_SLOT_COUNT] = {0};
1019 unsigned int element_count[D3D11_SO_BUFFER_SLOT_COUNT] = {0};
1020 unsigned int gap_count[D3D11_SO_BUFFER_SLOT_COUNT] = {0};
1021
1022 for (j = 0; j < entry_count; ++j)
1023 {
1024 const D3D11_SO_DECLARATION_ENTRY *e = &entries[j];
1025
1026 if (e->Stream != i)
1027 continue;
1028 current_stride[e->OutputSlot] += 4 * e->ComponentCount;
1029 ++element_count[e->OutputSlot];
1030 if (!e->SemanticName)
1031 ++gap_count[e->OutputSlot];
1032 }
1033
1034 for (j = 0; j < D3D11_SO_BUFFER_SLOT_COUNT; ++j)
1035 {
1036 if (!element_count[j])
1037 continue;
1038 if (element_count[j] == gap_count[j])
1039 {
1040 WARN("Stream %u, output slot %u contains only gaps.\n", i, j);
1041 return E_INVALIDARG;
1042 }
1043 if (buffer_stride_count)
1044 {
1045 if (buffer_stride_count <= j)
1046 {
1047 WARN("Buffer strides are required for all buffer slots.\n");
1048 return E_INVALIDARG;
1049 }
1050 if (buffer_strides[j] < current_stride[j] || buffer_strides[j] % 4)
1051 {
1052 WARN("Invalid stride %u for buffer slot %u.\n", buffer_strides[j], j);
1053 return E_INVALIDARG;
1054 }
1055 }
1056 }
1057
1058 if (!i && feature_level < D3D_FEATURE_LEVEL_11_0 && element_count[0] != entry_count)
1059 {
1060 for (j = 0; j < ARRAY_SIZE(element_count); ++j)
1061 {
1062 if (element_count[j] > 1)
1063 {
1064 WARN("Only one element per output slot is allowed.\n");
1065 return E_INVALIDARG;
1066 }
1067 }
1068 }
1069 }
1070
1071 return S_OK;
1072}
const UINT D3D11_SO_BUFFER_SLOT_COUNT
Definition: d3d11.idl:253
#define stricmp(_String1, _String2)
Definition: compat.h:24
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 GLint GLint j
Definition: glfuncs.h:250
#define e
Definition: ke_i.h:82
static ULONG ** element_count
Definition: exception.c:124

Referenced by d3d_geometry_shader_init().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d11  )

Variable Documentation

◆ d3d10_geometry_shader_vtbl

const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl
static
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_GetPrivateData(ID3D10GeometryShader *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:875
static void STDMETHODCALLTYPE d3d10_geometry_shader_GetDevice(ID3D10GeometryShader *iface, ID3D10Device **device)
Definition: shader.c:866
static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_AddRef(ID3D10GeometryShader *iface)
Definition: shader.c:846
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateData(ID3D10GeometryShader *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:886
static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_Release(ID3D10GeometryShader *iface)
Definition: shader.c:855
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_QueryInterface(ID3D10GeometryShader *iface, REFIID riid, void **object)
Definition: shader.c:836
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateDataInterface(ID3D10GeometryShader *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:897

Definition at line 907 of file shader.c.

Referenced by d3d_geometry_shader_init(), and unsafe_impl_from_ID3D10GeometryShader().

◆ d3d10_pixel_shader_vtbl

const struct ID3D10PixelShaderVtbl d3d10_pixel_shader_vtbl
static
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_GetPrivateData(ID3D10PixelShader *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:1373
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateData(ID3D10PixelShader *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:1384
static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_AddRef(ID3D10PixelShader *iface)
Definition: shader.c:1344
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_QueryInterface(ID3D10PixelShader *iface, REFIID riid, void **object)
Definition: shader.c:1334
static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release(ID3D10PixelShader *iface)
Definition: shader.c:1353
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateDataInterface(ID3D10PixelShader *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:1395
static void STDMETHODCALLTYPE d3d10_pixel_shader_GetDevice(ID3D10PixelShader *iface, ID3D10Device **device)
Definition: shader.c:1364

Definition at line 1405 of file shader.c.

Referenced by d3d_pixel_shader_init(), and unsafe_impl_from_ID3D10PixelShader().

◆ d3d10_vertex_shader_vtbl

const struct ID3D10VertexShaderVtbl d3d10_vertex_shader_vtbl
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d10_vertex_shader_GetDevice(ID3D10VertexShader *iface, ID3D10Device **device)
Definition: shader.c:191
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_GetPrivateData(ID3D10VertexShader *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:200
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_QueryInterface(ID3D10VertexShader *iface, REFIID riid, void **object)
Definition: shader.c:161
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateDataInterface(ID3D10VertexShader *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:222
static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_AddRef(ID3D10VertexShader *iface)
Definition: shader.c:171
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateData(ID3D10VertexShader *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:211
static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_Release(ID3D10VertexShader *iface)
Definition: shader.c:180

Definition at line 232 of file shader.c.

Referenced by d3d_vertex_shader_init(), and unsafe_impl_from_ID3D10VertexShader().

◆ d3d11_class_linkage_vtbl

const struct ID3D11ClassLinkageVtbl d3d11_class_linkage_vtbl
static
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_SetPrivateDataInterface(ID3D11ClassLinkage *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:1771
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_GetClassInstance(ID3D11ClassLinkage *iface, const char *instance_name, UINT instance_index, ID3D11ClassInstance **class_instance)
Definition: shader.c:1781
static void STDMETHODCALLTYPE d3d11_class_linkage_GetDevice(ID3D11ClassLinkage *iface, ID3D11Device **device)
Definition: shader.c:1741
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_GetPrivateData(ID3D11ClassLinkage *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:1751
static ULONG STDMETHODCALLTYPE d3d11_class_linkage_AddRef(ID3D11ClassLinkage *iface)
Definition: shader.c:1711
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_CreateClassInstance(ID3D11ClassLinkage *iface, const char *type_name, UINT cb_offset, UINT cb_vector_offset, UINT texture_offset, UINT sampler_offset, ID3D11ClassInstance **class_instance)
Definition: shader.c:1790
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_QueryInterface(ID3D11ClassLinkage *iface, REFIID riid, void **object)
Definition: shader.c:1692
static ULONG STDMETHODCALLTYPE d3d11_class_linkage_Release(ID3D11ClassLinkage *iface)
Definition: shader.c:1721
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_SetPrivateData(ID3D11ClassLinkage *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:1761

Definition at line 1802 of file shader.c.

Referenced by d3d11_class_linkage_create().

◆ d3d11_compute_shader_vtbl

const struct ID3D11ComputeShaderVtbl d3d11_compute_shader_vtbl
static
Initial value:
=
{
}
static ULONG STDMETHODCALLTYPE d3d11_compute_shader_AddRef(ID3D11ComputeShader *iface)
Definition: shader.c:1526
static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_QueryInterface(ID3D11ComputeShader *iface, REFIID riid, void **object)
Definition: shader.c:1507
static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_SetPrivateData(ID3D11ComputeShader *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:1581
static ULONG STDMETHODCALLTYPE d3d11_compute_shader_Release(ID3D11ComputeShader *iface)
Definition: shader.c:1542
static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_SetPrivateDataInterface(ID3D11ComputeShader *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:1591
static HRESULT STDMETHODCALLTYPE d3d11_compute_shader_GetPrivateData(ID3D11ComputeShader *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:1571
static void STDMETHODCALLTYPE d3d11_compute_shader_GetDevice(ID3D11ComputeShader *iface, ID3D11Device **device)
Definition: shader.c:1561

Definition at line 1601 of file shader.c.

Referenced by d3d11_compute_shader_init(), and unsafe_impl_from_ID3D11ComputeShader().

◆ d3d11_compute_shader_wined3d_parent_ops

const struct wined3d_parent_ops d3d11_compute_shader_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d11_compute_shader_wined3d_object_destroyed(void *parent)
Definition: shader.c:1614

Definition at line 1622 of file shader.c.

Referenced by d3d11_compute_shader_init().

◆ d3d11_domain_shader_vtbl

const struct ID3D11DomainShaderVtbl d3d11_domain_shader_vtbl
static
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_SetPrivateDataInterface(ID3D11DomainShader *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:607
static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_GetPrivateData(ID3D11DomainShader *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:587
static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_QueryInterface(ID3D11DomainShader *iface, REFIID riid, void **object)
Definition: shader.c:521
static ULONG STDMETHODCALLTYPE d3d11_domain_shader_AddRef(ID3D11DomainShader *iface)
Definition: shader.c:541
static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release(ID3D11DomainShader *iface)
Definition: shader.c:557
static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_SetPrivateData(ID3D11DomainShader *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:597
static void STDMETHODCALLTYPE d3d11_domain_shader_GetDevice(ID3D11DomainShader *iface, ID3D11Device **device)
Definition: shader.c:576

Definition at line 617 of file shader.c.

Referenced by d3d11_domain_shader_init(), and unsafe_impl_from_ID3D11DomainShader().

◆ d3d11_domain_shader_wined3d_parent_ops

const struct wined3d_parent_ops d3d11_domain_shader_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d11_domain_shader_wined3d_object_destroyed(void *parent)
Definition: shader.c:630

Definition at line 638 of file shader.c.

Referenced by d3d11_domain_shader_init().

◆ d3d11_geometry_shader_vtbl

const struct ID3D11GeometryShaderVtbl d3d11_geometry_shader_vtbl
static
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_SetPrivateData(ID3D11GeometryShader *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:794
static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_GetPrivateData(ID3D11GeometryShader *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:784
static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_SetPrivateDataInterface(ID3D11GeometryShader *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:804
static void STDMETHODCALLTYPE d3d11_geometry_shader_GetDevice(ID3D11GeometryShader *iface, ID3D11Device **device)
Definition: shader.c:773

Definition at line 814 of file shader.c.

Referenced by d3d_geometry_shader_init(), and unsafe_impl_from_ID3D11GeometryShader().

◆ d3d11_hull_shader_vtbl

const struct ID3D11HullShaderVtbl d3d11_hull_shader_vtbl
static
Initial value:
=
{
}
static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release(ID3D11HullShader *iface)
Definition: shader.c:370
static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_SetPrivateData(ID3D11HullShader *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:410
static ULONG STDMETHODCALLTYPE d3d11_hull_shader_AddRef(ID3D11HullShader *iface)
Definition: shader.c:354
static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_GetPrivateData(ID3D11HullShader *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:400
static void STDMETHODCALLTYPE d3d11_hull_shader_GetDevice(ID3D11HullShader *iface, ID3D11Device **device)
Definition: shader.c:389
static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_SetPrivateDataInterface(ID3D11HullShader *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:420
static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_QueryInterface(ID3D11HullShader *iface, REFIID riid, void **object)
Definition: shader.c:334

Definition at line 430 of file shader.c.

Referenced by d3d11_hull_shader_init(), and unsafe_impl_from_ID3D11HullShader().

◆ d3d11_hull_shader_wined3d_parent_ops

const struct wined3d_parent_ops d3d11_hull_shader_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d11_hull_shader_wined3d_object_destroyed(void *parent)
Definition: shader.c:443

Definition at line 451 of file shader.c.

Referenced by d3d11_hull_shader_init().

◆ d3d11_pixel_shader_vtbl

const struct ID3D11PixelShaderVtbl d3d11_pixel_shader_vtbl
static
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_SetPrivateData(ID3D11PixelShader *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:1292
static void STDMETHODCALLTYPE d3d11_pixel_shader_GetDevice(ID3D11PixelShader *iface, ID3D11Device **device)
Definition: shader.c:1271
static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_SetPrivateDataInterface(ID3D11PixelShader *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:1302
static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_GetPrivateData(ID3D11PixelShader *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:1282

Definition at line 1312 of file shader.c.

Referenced by d3d_pixel_shader_init(), and unsafe_impl_from_ID3D11PixelShader().

◆ d3d11_vertex_shader_vtbl

const struct ID3D11VertexShaderVtbl d3d11_vertex_shader_vtbl
static
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_SetPrivateData(ID3D11VertexShader *iface, REFGUID guid, UINT data_size, const void *data)
Definition: shader.c:119
static void STDMETHODCALLTYPE d3d11_vertex_shader_GetDevice(ID3D11VertexShader *iface, ID3D11Device **device)
Definition: shader.c:98
static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_GetPrivateData(ID3D11VertexShader *iface, REFGUID guid, UINT *data_size, void *data)
Definition: shader.c:109
static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_SetPrivateDataInterface(ID3D11VertexShader *iface, REFGUID guid, const IUnknown *data)
Definition: shader.c:129

Definition at line 139 of file shader.c.

Referenced by d3d_vertex_shader_init(), and unsafe_impl_from_ID3D11VertexShader().

◆ d3d_geometry_shader_wined3d_parent_ops

const struct wined3d_parent_ops d3d_geometry_shader_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d_geometry_shader_wined3d_object_destroyed(void *parent)
Definition: shader.c:920

Definition at line 928 of file shader.c.

Referenced by d3d_geometry_shader_init().

◆ d3d_pixel_shader_wined3d_parent_ops

const struct wined3d_parent_ops d3d_pixel_shader_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d_pixel_shader_wined3d_object_destroyed(void *parent)
Definition: shader.c:1418

Definition at line 1426 of file shader.c.

Referenced by d3d_pixel_shader_init().

◆ d3d_vertex_shader_wined3d_parent_ops

const struct wined3d_parent_ops d3d_vertex_shader_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d_vertex_shader_wined3d_object_destroyed(void *parent)
Definition: shader.c:245

Definition at line 253 of file shader.c.

Referenced by d3d_vertex_shader_init().