krnl386: Avoid using the selector functions from libwine.
[wine/zf.git] / include / d3d11shader.h
blob501d01ee84a2875e60aa78cfb296d49898b6942c
1 /*
2 * Copyright 2010 Matteo Bruni for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __D3D11SHADER_H__
20 #define __D3D11SHADER_H__
22 #include "d3dcommon.h"
24 /* These are defined as version-neutral in d3dcommon.h */
25 typedef D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE;
27 typedef D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE;
29 typedef D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN;
31 typedef D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING;
33 typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE;
35 typedef struct _D3D11_SHADER_DESC
37 UINT Version;
38 const char *Creator;
39 UINT Flags;
40 UINT ConstantBuffers;
41 UINT BoundResources;
42 UINT InputParameters;
43 UINT OutputParameters;
44 UINT InstructionCount;
45 UINT TempRegisterCount;
46 UINT TempArrayCount;
47 UINT DefCount;
48 UINT DclCount;
49 UINT TextureNormalInstructions;
50 UINT TextureLoadInstructions;
51 UINT TextureCompInstructions;
52 UINT TextureBiasInstructions;
53 UINT TextureGradientInstructions;
54 UINT FloatInstructionCount;
55 UINT IntInstructionCount;
56 UINT UintInstructionCount;
57 UINT StaticFlowControlCount;
58 UINT DynamicFlowControlCount;
59 UINT MacroInstructionCount;
60 UINT ArrayInstructionCount;
61 UINT CutInstructionCount;
62 UINT EmitInstructionCount;
63 D3D_PRIMITIVE_TOPOLOGY GSOutputTopology;
64 UINT GSMaxOutputVertexCount;
65 D3D_PRIMITIVE InputPrimitive;
66 UINT PatchConstantParameters;
67 UINT cGSInstanceCount;
68 UINT cControlPoints;
69 D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive;
70 D3D_TESSELLATOR_PARTITIONING HSPartitioning;
71 D3D_TESSELLATOR_DOMAIN TessellatorDomain;
72 UINT cBarrierInstructions;
73 UINT cInterlockedInstructions;
74 UINT cTextureStoreInstructions;
75 } D3D11_SHADER_DESC;
77 typedef struct _D3D11_SHADER_VARIABLE_DESC
79 const char *Name;
80 UINT StartOffset;
81 UINT Size;
82 UINT uFlags;
83 void *DefaultValue;
84 UINT StartTexture;
85 UINT TextureSize;
86 UINT StartSampler;
87 UINT SamplerSize;
88 } D3D11_SHADER_VARIABLE_DESC;
90 typedef struct _D3D11_SHADER_TYPE_DESC
92 D3D_SHADER_VARIABLE_CLASS Class;
93 D3D_SHADER_VARIABLE_TYPE Type;
94 UINT Rows;
95 UINT Columns;
96 UINT Elements;
97 UINT Members;
98 UINT Offset;
99 const char *Name;
100 } D3D11_SHADER_TYPE_DESC;
102 typedef struct _D3D11_SHADER_BUFFER_DESC
104 const char *Name;
105 D3D_CBUFFER_TYPE Type;
106 UINT Variables;
107 UINT Size;
108 UINT uFlags;
109 } D3D11_SHADER_BUFFER_DESC;
111 typedef struct _D3D11_SHADER_INPUT_BIND_DESC
113 const char *Name;
114 D3D_SHADER_INPUT_TYPE Type;
115 UINT BindPoint;
116 UINT BindCount;
117 UINT uFlags;
118 D3D_RESOURCE_RETURN_TYPE ReturnType;
119 D3D_SRV_DIMENSION Dimension;
120 UINT NumSamples;
121 } D3D11_SHADER_INPUT_BIND_DESC;
123 typedef struct _D3D11_SIGNATURE_PARAMETER_DESC
125 const char *SemanticName;
126 UINT SemanticIndex;
127 UINT Register;
128 D3D_NAME SystemValueType;
129 D3D_REGISTER_COMPONENT_TYPE ComponentType;
130 BYTE Mask;
131 BYTE ReadWriteMask;
132 UINT Stream;
133 #if D3D_COMPILER_VERSION >= 46
134 D3D_MIN_PRECISION MinPrecision;
135 #endif
136 } D3D11_SIGNATURE_PARAMETER_DESC;
138 DEFINE_GUID(IID_ID3D11ShaderReflectionType, 0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
140 #define INTERFACE ID3D11ShaderReflectionType
141 DECLARE_INTERFACE(ID3D11ShaderReflectionType)
143 STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_TYPE_DESC *desc) PURE;
144 STDMETHOD_(struct ID3D11ShaderReflectionType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
145 STDMETHOD_(struct ID3D11ShaderReflectionType *, GetMemberTypeByName)(THIS_ const char *name) PURE;
146 STDMETHOD_(const char *, GetMemberTypeName)(THIS_ UINT index) PURE;
147 STDMETHOD(IsEqual)(THIS_ struct ID3D11ShaderReflectionType *type) PURE;
148 STDMETHOD_(struct ID3D11ShaderReflectionType *, GetSubType)(THIS) PURE;
149 STDMETHOD_(struct ID3D11ShaderReflectionType *, GetBaseClass)(THIS) PURE;
150 STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
151 STDMETHOD_(struct ID3D11ShaderReflectionType *, GetInterfaceByIndex)(THIS_ UINT index) PURE;
152 STDMETHOD(IsOfType)(THIS_ struct ID3D11ShaderReflectionType *type) PURE;
153 STDMETHOD(ImplementsInterface)(THIS_ ID3D11ShaderReflectionType *base) PURE;
155 #undef INTERFACE
157 DEFINE_GUID(IID_ID3D11ShaderReflectionVariable, 0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c);
159 #define INTERFACE ID3D11ShaderReflectionVariable
160 DECLARE_INTERFACE(ID3D11ShaderReflectionVariable)
162 STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_VARIABLE_DESC *desc) PURE;
163 STDMETHOD_(struct ID3D11ShaderReflectionType *, GetType)(THIS) PURE;
164 STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetBuffer)(THIS) PURE;
165 STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ UINT index) PURE;
167 #undef INTERFACE
169 DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer, 0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8);
171 #define INTERFACE ID3D11ShaderReflectionConstantBuffer
172 DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer)
174 STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *desc) PURE;
175 STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
176 STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE;
178 #undef INTERFACE
180 #if D3D_COMPILER_VERSION <= 42
181 DEFINE_GUID(IID_ID3D11ShaderReflection, 0x17f27486, 0xa342, 0x4d10, 0x88, 0x42, 0xab, 0x08, 0x74, 0xe7, 0xf6, 0x70);
182 #elif D3D_COMPILER_VERSION == 43
183 DEFINE_GUID(IID_ID3D11ShaderReflection, 0x0a233719, 0x3960, 0x4578, 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1);
184 #else
185 DEFINE_GUID(IID_ID3D11ShaderReflection, 0x8d536ca1, 0x0cca, 0x4956, 0xa8, 0x37, 0x78, 0x69, 0x63, 0x75, 0x55, 0x84);
186 #endif
188 #define INTERFACE ID3D11ShaderReflection
189 DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown)
191 /* IUnknown methods */
192 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
193 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
194 STDMETHOD_(ULONG, Release)(THIS) PURE;
195 /* ID3D11ShaderReflection methods */
196 STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_DESC *desc) PURE;
197 STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE;
198 STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ const char *name) PURE;
199 STDMETHOD(GetResourceBindingDesc)(THIS_ UINT index, D3D11_SHADER_INPUT_BIND_DESC *desc) PURE;
200 STDMETHOD(GetInputParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE;
201 STDMETHOD(GetOutputParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE;
202 STDMETHOD(GetPatchConstantParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE;
203 STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE;
204 STDMETHOD(GetResourceBindingDescByName)(THIS_ const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc) PURE;
205 STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
206 STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
207 STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
208 STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
209 STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
210 STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
211 STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
212 STDMETHOD(GetMinFeatureLevel)(THIS_ enum D3D_FEATURE_LEVEL *level) PURE;
213 STDMETHOD_(UINT, GetThreadGroupSize)(THIS_ UINT *sizex, UINT *sizey, UINT *sizez) PURE;
214 STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
216 #undef INTERFACE
218 DEFINE_GUID(IID_ID3D11ModuleInstance, 0x469e07f7, 0x45a, 0x48d5, 0xaa, 0x12, 0x68, 0xa4, 0x78, 0xcd, 0xf7, 0x5d);
220 #define INTERFACE ID3D11ModuleInstance
221 DECLARE_INTERFACE_(ID3D11ModuleInstance, IUnknown)
223 STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE;
224 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
225 STDMETHOD_(ULONG, Release)(THIS) PURE;
227 /* ID3D11ModuleInstance methods */
228 STDMETHOD(BindConstantBuffer)(THIS_ UINT srcslot, UINT dstslot, UINT dstoffset) PURE;
229 STDMETHOD(BindConstantBufferByName)(THIS_ const char *name, UINT dstslot, UINT dstoffset) PURE;
231 STDMETHOD(BindResource)(THIS_ UINT srcslot, UINT dstslot, UINT count) PURE;
232 STDMETHOD(BindResourceByName)(THIS_ const char *name, UINT dstslot, UINT count) PURE;
234 STDMETHOD(BindSampler)(THIS_ UINT srcslot, UINT dstslot, UINT count) PURE;
235 STDMETHOD(BindSamplerByName)(THIS_ const char *name, UINT dstslot, UINT count) PURE;
237 STDMETHOD(BindUnorderedAccessView)(THIS_ UINT srcslot, UINT dstslot, UINT count) PURE;
238 STDMETHOD(BindUnorderedAccessViewByName)(THIS_ const char *name, UINT dstslot, UINT count) PURE;
240 STDMETHOD(BindResourceAsUnorderedAccessView)(THIS_ UINT srcslot, UINT dstslot, UINT count) PURE;
241 STDMETHOD(BindResourceAsUnorderedAccessViewByName)(THIS_ const char *name, UINT dstslot, UINT count) PURE;
243 #undef INTERFACE
245 DEFINE_GUID(IID_ID3D11Module, 0xcac701ee, 0x80fc, 0x4122, 0x82, 0x42, 0x10, 0xb3, 0x9c, 0x8c, 0xec, 0x34);
247 #define INTERFACE ID3D11Module
248 DECLARE_INTERFACE_(ID3D11Module, IUnknown)
250 STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE;
251 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
252 STDMETHOD_(ULONG, Release)(THIS) PURE;
254 /* ID3D11Module methods */
255 STDMETHOD(CreateInstance)(THIS_ const char *instnamespace, ID3D11ModuleInstance **moduleinstance) PURE;
257 #undef INTERFACE
259 #endif