1c2c66affSColin Finck /*
2c2c66affSColin Finck * Copyright 2010 Matteo Bruni for CodeWeavers
3c2c66affSColin Finck *
4c2c66affSColin Finck * This library is free software; you can redistribute it and/or
5c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public
6c2c66affSColin Finck * License as published by the Free Software Foundation; either
7c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version.
8c2c66affSColin Finck *
9c2c66affSColin Finck * This library is distributed in the hope that it will be useful,
10c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of
11c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12c2c66affSColin Finck * Lesser General Public License for more details.
13c2c66affSColin Finck *
14c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public
15c2c66affSColin Finck * License along with this library; if not, write to the Free Software
16c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17c2c66affSColin Finck */
18c2c66affSColin Finck
19c2c66affSColin Finck #ifndef __D3D11SHADER_H__
20c2c66affSColin Finck #define __D3D11SHADER_H__
21c2c66affSColin Finck
22c2c66affSColin Finck #include "d3dcommon.h"
23c2c66affSColin Finck
24c2c66affSColin Finck /* These are defined as version-neutral in d3dcommon.h */
25c2c66affSColin Finck typedef D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE;
26c2c66affSColin Finck
27c2c66affSColin Finck typedef D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE;
28c2c66affSColin Finck
29c2c66affSColin Finck typedef D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN;
30c2c66affSColin Finck
31c2c66affSColin Finck typedef D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING;
32c2c66affSColin Finck
33c2c66affSColin Finck typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE;
34c2c66affSColin Finck
35c2c66affSColin Finck typedef struct _D3D11_SHADER_DESC
36c2c66affSColin Finck {
37c2c66affSColin Finck UINT Version;
38c2c66affSColin Finck const char *Creator;
39c2c66affSColin Finck UINT Flags;
40c2c66affSColin Finck UINT ConstantBuffers;
41c2c66affSColin Finck UINT BoundResources;
42c2c66affSColin Finck UINT InputParameters;
43c2c66affSColin Finck UINT OutputParameters;
44c2c66affSColin Finck UINT InstructionCount;
45c2c66affSColin Finck UINT TempRegisterCount;
46c2c66affSColin Finck UINT TempArrayCount;
47c2c66affSColin Finck UINT DefCount;
48c2c66affSColin Finck UINT DclCount;
49c2c66affSColin Finck UINT TextureNormalInstructions;
50c2c66affSColin Finck UINT TextureLoadInstructions;
51c2c66affSColin Finck UINT TextureCompInstructions;
52c2c66affSColin Finck UINT TextureBiasInstructions;
53c2c66affSColin Finck UINT TextureGradientInstructions;
54c2c66affSColin Finck UINT FloatInstructionCount;
55c2c66affSColin Finck UINT IntInstructionCount;
56c2c66affSColin Finck UINT UintInstructionCount;
57c2c66affSColin Finck UINT StaticFlowControlCount;
58c2c66affSColin Finck UINT DynamicFlowControlCount;
59c2c66affSColin Finck UINT MacroInstructionCount;
60c2c66affSColin Finck UINT ArrayInstructionCount;
61c2c66affSColin Finck UINT CutInstructionCount;
62c2c66affSColin Finck UINT EmitInstructionCount;
63c2c66affSColin Finck D3D_PRIMITIVE_TOPOLOGY GSOutputTopology;
64c2c66affSColin Finck UINT GSMaxOutputVertexCount;
65c2c66affSColin Finck D3D_PRIMITIVE InputPrimitive;
66c2c66affSColin Finck UINT PatchConstantParameters;
67c2c66affSColin Finck UINT cGSInstanceCount;
68c2c66affSColin Finck UINT cControlPoints;
69c2c66affSColin Finck D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive;
70c2c66affSColin Finck D3D_TESSELLATOR_PARTITIONING HSPartitioning;
71c2c66affSColin Finck D3D_TESSELLATOR_DOMAIN TessellatorDomain;
72c2c66affSColin Finck UINT cBarrierInstructions;
73c2c66affSColin Finck UINT cInterlockedInstructions;
74c2c66affSColin Finck UINT cTextureStoreInstructions;
75c2c66affSColin Finck } D3D11_SHADER_DESC;
76c2c66affSColin Finck
77c2c66affSColin Finck typedef struct _D3D11_SHADER_VARIABLE_DESC
78c2c66affSColin Finck {
79c2c66affSColin Finck const char *Name;
80c2c66affSColin Finck UINT StartOffset;
81c2c66affSColin Finck UINT Size;
82c2c66affSColin Finck UINT uFlags;
83c2c66affSColin Finck void *DefaultValue;
84c2c66affSColin Finck UINT StartTexture;
85c2c66affSColin Finck UINT TextureSize;
86c2c66affSColin Finck UINT StartSampler;
87c2c66affSColin Finck UINT SamplerSize;
88c2c66affSColin Finck } D3D11_SHADER_VARIABLE_DESC;
89c2c66affSColin Finck
90c2c66affSColin Finck typedef struct _D3D11_SHADER_TYPE_DESC
91c2c66affSColin Finck {
92c2c66affSColin Finck D3D_SHADER_VARIABLE_CLASS Class;
93c2c66affSColin Finck D3D_SHADER_VARIABLE_TYPE Type;
94c2c66affSColin Finck UINT Rows;
95c2c66affSColin Finck UINT Columns;
96c2c66affSColin Finck UINT Elements;
97c2c66affSColin Finck UINT Members;
98c2c66affSColin Finck UINT Offset;
99c2c66affSColin Finck const char *Name;
100c2c66affSColin Finck } D3D11_SHADER_TYPE_DESC;
101c2c66affSColin Finck
102c2c66affSColin Finck typedef struct _D3D11_SHADER_BUFFER_DESC
103c2c66affSColin Finck {
104c2c66affSColin Finck const char *Name;
105c2c66affSColin Finck D3D_CBUFFER_TYPE Type;
106c2c66affSColin Finck UINT Variables;
107c2c66affSColin Finck UINT Size;
108c2c66affSColin Finck UINT uFlags;
109c2c66affSColin Finck } D3D11_SHADER_BUFFER_DESC;
110c2c66affSColin Finck
111c2c66affSColin Finck typedef struct _D3D11_SHADER_INPUT_BIND_DESC
112c2c66affSColin Finck {
113c2c66affSColin Finck const char *Name;
114c2c66affSColin Finck D3D_SHADER_INPUT_TYPE Type;
115c2c66affSColin Finck UINT BindPoint;
116c2c66affSColin Finck UINT BindCount;
117c2c66affSColin Finck UINT uFlags;
118c2c66affSColin Finck D3D_RESOURCE_RETURN_TYPE ReturnType;
119c2c66affSColin Finck D3D_SRV_DIMENSION Dimension;
120c2c66affSColin Finck UINT NumSamples;
121c2c66affSColin Finck } D3D11_SHADER_INPUT_BIND_DESC;
122c2c66affSColin Finck
123c2c66affSColin Finck typedef struct _D3D11_SIGNATURE_PARAMETER_DESC
124c2c66affSColin Finck {
125c2c66affSColin Finck const char *SemanticName;
126c2c66affSColin Finck UINT SemanticIndex;
127c2c66affSColin Finck UINT Register;
128c2c66affSColin Finck D3D_NAME SystemValueType;
129c2c66affSColin Finck D3D_REGISTER_COMPONENT_TYPE ComponentType;
130c2c66affSColin Finck BYTE Mask;
131c2c66affSColin Finck BYTE ReadWriteMask;
132c2c66affSColin Finck UINT Stream;
133c2c66affSColin Finck } D3D11_SIGNATURE_PARAMETER_DESC;
134c2c66affSColin Finck
135c2c66affSColin Finck DEFINE_GUID(IID_ID3D11ShaderReflectionType, 0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
136c2c66affSColin Finck
137c2c66affSColin Finck #define INTERFACE ID3D11ShaderReflectionType
DECLARE_INTERFACE(ID3D11ShaderReflectionType)138c2c66affSColin Finck DECLARE_INTERFACE(ID3D11ShaderReflectionType)
139c2c66affSColin Finck {
140c2c66affSColin Finck STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_TYPE_DESC *desc) PURE;
141c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
142c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionType *, GetMemberTypeByName)(THIS_ const char *name) PURE;
143c2c66affSColin Finck STDMETHOD_(const char *, GetMemberTypeName)(THIS_ UINT index) PURE;
144c2c66affSColin Finck STDMETHOD(IsEqual)(THIS_ struct ID3D11ShaderReflectionType *type) PURE;
145c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionType *, GetSubType)(THIS) PURE;
146c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionType *, GetBaseClass)(THIS) PURE;
147c2c66affSColin Finck STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
148c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionType *, GetInterfaceByIndex)(THIS_ UINT index) PURE;
149c2c66affSColin Finck STDMETHOD(IsOfType)(THIS_ struct ID3D11ShaderReflectionType *type) PURE;
150c2c66affSColin Finck STDMETHOD(ImplementsInterface)(THIS_ ID3D11ShaderReflectionType *base) PURE;
151c2c66affSColin Finck };
152c2c66affSColin Finck #undef INTERFACE
153c2c66affSColin Finck
154c2c66affSColin Finck DEFINE_GUID(IID_ID3D11ShaderReflectionVariable, 0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c);
155c2c66affSColin Finck
156c2c66affSColin Finck #define INTERFACE ID3D11ShaderReflectionVariable
DECLARE_INTERFACE(ID3D11ShaderReflectionVariable)157c2c66affSColin Finck DECLARE_INTERFACE(ID3D11ShaderReflectionVariable)
158c2c66affSColin Finck {
159c2c66affSColin Finck STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_VARIABLE_DESC *desc) PURE;
160c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionType *, GetType)(THIS) PURE;
161c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetBuffer)(THIS) PURE;
162c2c66affSColin Finck STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ UINT index) PURE;
163c2c66affSColin Finck };
164c2c66affSColin Finck #undef INTERFACE
165c2c66affSColin Finck
166c2c66affSColin Finck DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer, 0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8);
167c2c66affSColin Finck
168c2c66affSColin Finck #define INTERFACE ID3D11ShaderReflectionConstantBuffer
DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer)169c2c66affSColin Finck DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer)
170c2c66affSColin Finck {
171c2c66affSColin Finck STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *desc) PURE;
172c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
173c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE;
174c2c66affSColin Finck };
175c2c66affSColin Finck #undef INTERFACE
176c2c66affSColin Finck
177c2c66affSColin Finck DEFINE_GUID(IID_ID3D11ShaderReflection, 0x0a233719, 0x3960, 0x4578, 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1);
178c2c66affSColin Finck
179c2c66affSColin Finck #define INTERFACE ID3D11ShaderReflection
DECLARE_INTERFACE_(ID3D11ShaderReflection,IUnknown)180c2c66affSColin Finck DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown)
181c2c66affSColin Finck {
182c2c66affSColin Finck /* IUnknown methods */
183c2c66affSColin Finck STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
184c2c66affSColin Finck STDMETHOD_(ULONG, AddRef)(THIS) PURE;
185c2c66affSColin Finck STDMETHOD_(ULONG, Release)(THIS) PURE;
186c2c66affSColin Finck /* ID3D11ShaderReflection methods */
187c2c66affSColin Finck STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_DESC *desc) PURE;
188c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE;
189c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ const char *name) PURE;
190c2c66affSColin Finck STDMETHOD(GetResourceBindingDesc)(THIS_ UINT index, D3D11_SHADER_INPUT_BIND_DESC *desc) PURE;
191c2c66affSColin Finck STDMETHOD(GetInputParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE;
192c2c66affSColin Finck STDMETHOD(GetOutputParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE;
193c2c66affSColin Finck STDMETHOD(GetPatchConstantParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE;
194c2c66affSColin Finck STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE;
195c2c66affSColin Finck STDMETHOD(GetResourceBindingDescByName)(THIS_ const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc) PURE;
196c2c66affSColin Finck STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
197c2c66affSColin Finck STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
198c2c66affSColin Finck STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
199c2c66affSColin Finck STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
200c2c66affSColin Finck STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
201c2c66affSColin Finck STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
202c2c66affSColin Finck STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
203c2c66affSColin Finck STDMETHOD(GetMinFeatureLevel)(THIS_ enum D3D_FEATURE_LEVEL *level) PURE;
204c2c66affSColin Finck STDMETHOD_(UINT, GetThreadGroupSize)(THIS_ UINT *sizex, UINT *sizey, UINT *sizez) PURE;
205*3c0800acSAmine Khaldi STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
206c2c66affSColin Finck };
207c2c66affSColin Finck #undef INTERFACE
208c2c66affSColin Finck
209c2c66affSColin Finck #endif
210