RetroArch
d3d11shader.h
Go to the documentation of this file.
1 //
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 //
5 // File: D3D11Shader.h
6 // Content: D3D11 Shader Types and APIs
7 //
9 
10 #ifndef __D3D11SHADER_H__
11 #define __D3D11SHADER_H__
12 
13 #include "d3dcommon.h"
14 
15 
17 {
21 
22  // D3D11 Shaders
26 
29 
30 #define D3D11_SHVER_GET_TYPE(_Version) \
31  (((_Version) >> 16) & 0xffff)
32 #define D3D11_SHVER_GET_MAJOR(_Version) \
33  (((_Version) >> 4) & 0xf)
34 #define D3D11_SHVER_GET_MINOR(_Version) \
35  (((_Version) >> 0) & 0xf)
36 
37 // Slot ID for library function return
38 #define D3D_RETURN_PARAMETER_INDEX (-1)
39 
41 
43 
44 
46 {
47  LPCSTR SemanticName; // Name of the semantic
48  UINT SemanticIndex; // Index of the semantic
49  UINT Register; // Number of member variables
50  D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
51  D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)
52  BYTE Mask; // Mask to indicate which components of the register
53  // are used (combination of D3D10_COMPONENT_MASK values)
54  BYTE ReadWriteMask; // Mask to indicate whether a given component is
55  // never written (if this is an output signature) or
56  // always read (if this is an input signature).
57  // (combination of D3D_MASK_* values)
58  UINT Stream; // Stream index
59  D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision
61 
63 {
64  LPCSTR Name; // Name of the constant buffer
65  D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
66  UINT Variables; // Number of member variables
67  UINT Size; // Size of CB (in bytes)
68  UINT uFlags; // Buffer description flags
70 
72 {
73  LPCSTR Name; // Name of the variable
74  UINT StartOffset; // Offset in constant buffer's backing store
75  UINT Size; // Size of variable (in bytes)
76  UINT uFlags; // Variable flags
77  LPVOID DefaultValue; // Raw pointer to default value
78  UINT StartTexture; // First texture index (or -1 if no textures used)
79  UINT TextureSize; // Number of texture slots possibly used.
80  UINT StartSampler; // First sampler index (or -1 if no textures used)
81  UINT SamplerSize; // Number of sampler slots possibly used.
83 
85 {
86  D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
87  D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
88  UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
89  UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
90  UINT Elements; // Number of elements (0 if not an array)
91  UINT Members; // Number of members (0 if not a structure)
92  UINT Offset; // Offset from the start of structure (0 if not a structure member)
93  LPCSTR Name; // Name of type, can be NULL
95 
97 
99 
101 
102 typedef struct _D3D11_SHADER_DESC
103 {
104  UINT Version; // Shader version
105  LPCSTR Creator; // Creator string
106  UINT Flags; // Shader compilation/parse flags
107 
108  UINT ConstantBuffers; // Number of constant buffers
109  UINT BoundResources; // Number of bound resources
110  UINT InputParameters; // Number of parameters in the input signature
111  UINT OutputParameters; // Number of parameters in the output signature
112 
113  UINT InstructionCount; // Number of emitted instructions
114  UINT TempRegisterCount; // Number of temporary registers used
115  UINT TempArrayCount; // Number of temporary arrays used
116  UINT DefCount; // Number of constant defines
117  UINT DclCount; // Number of declarations (input + output)
118  UINT TextureNormalInstructions; // Number of non-categorized texture instructions
119  UINT TextureLoadInstructions; // Number of texture load instructions
120  UINT TextureCompInstructions; // Number of texture comparison instructions
121  UINT TextureBiasInstructions; // Number of texture bias instructions
122  UINT TextureGradientInstructions; // Number of texture gradient instructions
123  UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
124  UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
125  UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
126  UINT StaticFlowControlCount; // Number of static flow control instructions used
127  UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
128  UINT MacroInstructionCount; // Number of macro instructions used
129  UINT ArrayInstructionCount; // Number of array instructions used
130  UINT CutInstructionCount; // Number of cut instructions used
131  UINT EmitInstructionCount; // Number of emit instructions used
132  D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
133  UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
134  D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
135  UINT PatchConstantParameters; // Number of parameters in the patch constant signature
136  UINT cGSInstanceCount; // Number of Geometry shader instances
137  UINT cControlPoints; // Number of control points in the HS->DS stage
138  D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
139  D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
140  D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
141  // instruction counts
142  UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
143  UINT cInterlockedInstructions; // Number of interlocked instructions
144  UINT cTextureStoreInstructions; // Number of texture writes
146 
148 {
149  LPCSTR Name; // Name of the resource
150  D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
151  UINT BindPoint; // Starting bind point
152  UINT BindCount; // Number of contiguous bind points (for arrays)
153 
154  UINT uFlags; // Input binding flags
155  D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
156  D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
157  UINT NumSamples; // Number of samples (0 if not MS texture)
159 
160 #define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
161 #define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
162 #define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
163 #define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
164 #define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
165 #define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
166 #define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
167 #define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
168 #define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
169 
170 
171 typedef struct _D3D11_LIBRARY_DESC
172 {
173  LPCSTR Creator; // The name of the originator of the library.
174  UINT Flags; // Compilation flags.
175  UINT FunctionCount; // Number of functions exported from the library.
177 
178 typedef struct _D3D11_FUNCTION_DESC
179 {
180  UINT Version; // Shader version
181  LPCSTR Creator; // Creator string
182  UINT Flags; // Shader compilation/parse flags
183 
184  UINT ConstantBuffers; // Number of constant buffers
185  UINT BoundResources; // Number of bound resources
186 
187  UINT InstructionCount; // Number of emitted instructions
188  UINT TempRegisterCount; // Number of temporary registers used
189  UINT TempArrayCount; // Number of temporary arrays used
190  UINT DefCount; // Number of constant defines
191  UINT DclCount; // Number of declarations (input + output)
192  UINT TextureNormalInstructions; // Number of non-categorized texture instructions
193  UINT TextureLoadInstructions; // Number of texture load instructions
194  UINT TextureCompInstructions; // Number of texture comparison instructions
195  UINT TextureBiasInstructions; // Number of texture bias instructions
196  UINT TextureGradientInstructions; // Number of texture gradient instructions
197  UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
198  UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
199  UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
200  UINT StaticFlowControlCount; // Number of static flow control instructions used
201  UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
202  UINT MacroInstructionCount; // Number of macro instructions used
203  UINT ArrayInstructionCount; // Number of array instructions used
204  UINT MovInstructionCount; // Number of mov instructions used
205  UINT MovcInstructionCount; // Number of movc instructions used
206  UINT ConversionInstructionCount; // Number of type conversion instructions used
207  UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used
208  D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code
209  UINT64 RequiredFeatureFlags; // Required feature flags
210 
211  LPCSTR Name; // Function name
212  INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)
213  BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine
214  BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob
215  BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob
217 
218 typedef struct _D3D11_PARAMETER_DESC
219 {
220  LPCSTR Name; // Parameter name.
221  LPCSTR SemanticName; // Parameter semantic name (+index).
222  D3D_SHADER_VARIABLE_TYPE Type; // Element type.
223  D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.
224  UINT Rows; // Rows are for matrix parameters.
225  UINT Columns; // Components or Columns in matrix.
227  D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.
228 
229  UINT FirstInRegister; // The first input register for this parameter.
230  UINT FirstInComponent; // The first input register component for this parameter.
231  UINT FirstOutRegister; // The first output register for this parameter.
232  UINT FirstOutComponent; // The first output register component for this parameter.
234 
235 
237 // Interfaces ////////////////////////////////////////////////////////////////
239 
242 
245 
248 
251 
254 
257 
260 
261 // {6E6FFA6A-9BAE-4613-A51E-91652D508C21}
262 interface DECLSPEC_UUID("6E6FFA6A-9BAE-4613-A51E-91652D508C21") ID3D11ShaderReflectionType;
263 DEFINE_GUID(IID_ID3D11ShaderReflectionType,
264 0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
265 
266 #undef INTERFACE
267 #define INTERFACE ID3D11ShaderReflectionType
268 
270 {
271  STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_TYPE_DESC *pDesc) PURE;
272 
273  STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
274  STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
275  STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
276 
277  STDMETHOD(IsEqual)(THIS_ _In_ ID3D11ShaderReflectionType* pType) PURE;
278  STDMETHOD_(ID3D11ShaderReflectionType*, GetSubType)(THIS) PURE;
279  STDMETHOD_(ID3D11ShaderReflectionType*, GetBaseClass)(THIS) PURE;
280  STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
281  STDMETHOD_(ID3D11ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
282  STDMETHOD(IsOfType)(THIS_ _In_ ID3D11ShaderReflectionType* pType) PURE;
283  STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D11ShaderReflectionType* pBase) PURE;
284 };
285 
286 // {51F23923-F3E5-4BD1-91CB-606177D8DB4C}
287 interface DECLSPEC_UUID("51F23923-F3E5-4BD1-91CB-606177D8DB4C") ID3D11ShaderReflectionVariable;
288 DEFINE_GUID(IID_ID3D11ShaderReflectionVariable,
289 0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c);
290 
291 #undef INTERFACE
292 #define INTERFACE ID3D11ShaderReflectionVariable
293 
295 {
296  STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_VARIABLE_DESC *pDesc) PURE;
297 
298  STDMETHOD_(ID3D11ShaderReflectionType*, GetType)(THIS) PURE;
299  STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
300 
301  STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
302 };
303 
304 // {EB62D63D-93DD-4318-8AE8-C6F83AD371B8}
305 interface DECLSPEC_UUID("EB62D63D-93DD-4318-8AE8-C6F83AD371B8") ID3D11ShaderReflectionConstantBuffer;
306 DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer,
307 0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8);
308 
309 #undef INTERFACE
310 #define INTERFACE ID3D11ShaderReflectionConstantBuffer
311 
313 {
314  STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *pDesc) PURE;
315 
316  STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
317  STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
318 };
319 
320 // The ID3D11ShaderReflection IID may change from SDK version to SDK version
321 // if the reflection API changes. This prevents new code with the new API
322 // from working with an old binary. Recompiling with the new header
323 // will pick up the new IID.
324 
325 // 8d536ca1-0cca-4956-a837-786963755584
326 interface DECLSPEC_UUID("8d536ca1-0cca-4956-a837-786963755584") ID3D11ShaderReflection;
327 DEFINE_GUID(IID_ID3D11ShaderReflection,
328 0x8d536ca1, 0x0cca, 0x4956, 0xa8, 0x37, 0x78, 0x69, 0x63, 0x75, 0x55, 0x84);
329 
330 #undef INTERFACE
331 #define INTERFACE ID3D11ShaderReflection
332 
334 {
335  STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
336  _Out_ LPVOID *ppv) PURE;
337  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
338  STDMETHOD_(ULONG, Release)(THIS) PURE;
339 
340  STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_DESC *pDesc) PURE;
341 
342  STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
343  STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
344 
345  STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
346  _Out_ D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
347 
348  STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
349  _Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
350  STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
351  _Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
352  STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
353  _Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
354 
355  STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
356 
357  STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
358  _Out_ D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
359 
360  STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
361  STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
362  STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
363  STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
364 
365  STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
366  STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
367 
368  STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
369  STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
370 
371  STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
372  _Out_opt_ UINT* pSizeX,
373  _Out_opt_ UINT* pSizeY,
374  _Out_opt_ UINT* pSizeZ) PURE;
375 
376  STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
377 };
378 
379 // {54384F1B-5B3E-4BB7-AE01-60BA3097CBB6}
380 interface DECLSPEC_UUID("54384F1B-5B3E-4BB7-AE01-60BA3097CBB6") ID3D11LibraryReflection;
381 DEFINE_GUID(IID_ID3D11LibraryReflection,
382 0x54384f1b, 0x5b3e, 0x4bb7, 0xae, 0x1, 0x60, 0xba, 0x30, 0x97, 0xcb, 0xb6);
383 
384 #undef INTERFACE
385 #define INTERFACE ID3D11LibraryReflection
386 
388 {
389  STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
390  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
391  STDMETHOD_(ULONG, Release)(THIS) PURE;
392 
393  STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_LIBRARY_DESC * pDesc) PURE;
394 
395  STDMETHOD_(ID3D11FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
396 };
397 
398 // {207BCECB-D683-4A06-A8A3-9B149B9F73A4}
399 interface DECLSPEC_UUID("207BCECB-D683-4A06-A8A3-9B149B9F73A4") ID3D11FunctionReflection;
400 DEFINE_GUID(IID_ID3D11FunctionReflection,
401 0x207bcecb, 0xd683, 0x4a06, 0xa8, 0xa3, 0x9b, 0x14, 0x9b, 0x9f, 0x73, 0xa4);
402 
403 #undef INTERFACE
404 #define INTERFACE ID3D11FunctionReflection
405 
407 {
408  STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_FUNCTION_DESC * pDesc) PURE;
409 
410  STDMETHOD_(ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
411  STDMETHOD_(ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
412 
413  STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
414  _Out_ D3D11_SHADER_INPUT_BIND_DESC * pDesc) PURE;
415 
416  STDMETHOD_(ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
417 
418  STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
419  _Out_ D3D11_SHADER_INPUT_BIND_DESC * pDesc) PURE;
420 
421  // Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
422  STDMETHOD_(ID3D11FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
423 };
424 
425 // {42757488-334F-47FE-982E-1A65D08CC462}
426 interface DECLSPEC_UUID("42757488-334F-47FE-982E-1A65D08CC462") ID3D11FunctionParameterReflection;
427 DEFINE_GUID(IID_ID3D11FunctionParameterReflection,
428 0x42757488, 0x334f, 0x47fe, 0x98, 0x2e, 0x1a, 0x65, 0xd0, 0x8c, 0xc4, 0x62);
429 
430 #undef INTERFACE
431 #define INTERFACE ID3D11FunctionParameterReflection
432 
434 {
435  STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_PARAMETER_DESC * pDesc) PURE;
436 };
437 
438 // {CAC701EE-80FC-4122-8242-10B39C8CEC34}
439 interface DECLSPEC_UUID("CAC701EE-80FC-4122-8242-10B39C8CEC34") ID3D11Module;
440 DEFINE_GUID(IID_ID3D11Module,
441 0xcac701ee, 0x80fc, 0x4122, 0x82, 0x42, 0x10, 0xb3, 0x9c, 0x8c, 0xec, 0x34);
442 
443 #undef INTERFACE
444 #define INTERFACE ID3D11Module
445 
446 DECLARE_INTERFACE_(ID3D11Module, IUnknown)
447 {
448  STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
449  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
450  STDMETHOD_(ULONG, Release)(THIS) PURE;
451 
452  // Create an instance of a module for resource re-binding.
453  STDMETHOD(CreateInstance)(THIS_ _In_opt_ LPCSTR pNamespace,
454  _COM_Outptr_ interface ID3D11ModuleInstance ** ppModuleInstance) PURE;
455 };
456 
457 
458 // {469E07F7-045A-48D5-AA12-68A478CDF75D}
459 interface DECLSPEC_UUID("469E07F7-045A-48D5-AA12-68A478CDF75D") ID3D11ModuleInstance;
460 DEFINE_GUID(IID_ID3D11ModuleInstance,
461 0x469e07f7, 0x45a, 0x48d5, 0xaa, 0x12, 0x68, 0xa4, 0x78, 0xcd, 0xf7, 0x5d);
462 
463 #undef INTERFACE
464 #define INTERFACE ID3D11ModuleInstance
465 
466 DECLARE_INTERFACE_(ID3D11ModuleInstance, IUnknown)
467 {
468  STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
469  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
470  STDMETHOD_(ULONG, Release)(THIS) PURE;
471 
472  //
473  // Resource binding API.
474  //
475  STDMETHOD(BindConstantBuffer)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT cbDstOffset) PURE;
476  STDMETHOD(BindConstantBufferByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT cbDstOffset) PURE;
477 
478  STDMETHOD(BindResource)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
479  STDMETHOD(BindResourceByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
480 
481  STDMETHOD(BindSampler)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
482  STDMETHOD(BindSamplerByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
483 
484  STDMETHOD(BindUnorderedAccessView)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
485  STDMETHOD(BindUnorderedAccessViewByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
486 
487  STDMETHOD(BindResourceAsUnorderedAccessView)(THIS_ _In_ UINT uSrcSrvSlot, _In_ UINT uDstUavSlot, _In_ UINT uCount) PURE;
488  STDMETHOD(BindResourceAsUnorderedAccessViewByName)(THIS_ _In_ LPCSTR pSrvName, _In_ UINT uDstUavSlot, _In_ UINT uCount) PURE;
489 };
490 
491 
492 // {59A6CD0E-E10D-4C1F-88C0-63ABA1DAF30E}
493 interface DECLSPEC_UUID("59A6CD0E-E10D-4C1F-88C0-63ABA1DAF30E") ID3D11Linker;
494 DEFINE_GUID(IID_ID3D11Linker,
495 0x59a6cd0e, 0xe10d, 0x4c1f, 0x88, 0xc0, 0x63, 0xab, 0xa1, 0xda, 0xf3, 0xe);
496 
497 #undef INTERFACE
498 #define INTERFACE ID3D11Linker
499 
500 DECLARE_INTERFACE_(ID3D11Linker, IUnknown)
501 {
502  STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
503  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
504  STDMETHOD_(ULONG, Release)(THIS) PURE;
505 
506  // Link the shader and produce a shader blob suitable to D3D runtime.
507  STDMETHOD(Link)(THIS_ _In_ interface ID3D11ModuleInstance * pEntry,
508  _In_ LPCSTR pEntryName,
509  _In_ LPCSTR pTargetName,
510  _In_ UINT uFlags,
511  _COM_Outptr_ ID3DBlob ** ppShaderBlob,
512  _Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
513 
514  // Add an instance of a library module to be used for linking.
515  STDMETHOD(UseLibrary)(THIS_ _In_ interface ID3D11ModuleInstance * pLibraryMI) PURE;
516 
517  // Add a clip plane with the plane coefficients taken from a cbuffer entry for 10L9 shaders.
518  STDMETHOD(AddClipPlaneFromCBuffer)(THIS_ _In_ UINT uCBufferSlot, _In_ UINT uCBufferEntry) PURE;
519 };
520 
521 
522 // {D80DD70C-8D2F-4751-94A1-03C79B3556DB}
523 interface DECLSPEC_UUID("D80DD70C-8D2F-4751-94A1-03C79B3556DB") ID3D11LinkingNode;
524 DEFINE_GUID(IID_ID3D11LinkingNode,
525 0xd80dd70c, 0x8d2f, 0x4751, 0x94, 0xa1, 0x3, 0xc7, 0x9b, 0x35, 0x56, 0xdb);
526 
527 #undef INTERFACE
528 #define INTERFACE ID3D11LinkingNode
529 
530 DECLARE_INTERFACE_(ID3D11LinkingNode, IUnknown)
531 {
532  STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
533  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
534  STDMETHOD_(ULONG, Release)(THIS) PURE;
535 };
536 
537 
538 // {54133220-1CE8-43D3-8236-9855C5CEECFF}
539 interface DECLSPEC_UUID("54133220-1CE8-43D3-8236-9855C5CEECFF") ID3D11FunctionLinkingGraph;
540 DEFINE_GUID(IID_ID3D11FunctionLinkingGraph,
541 0x54133220, 0x1ce8, 0x43d3, 0x82, 0x36, 0x98, 0x55, 0xc5, 0xce, 0xec, 0xff);
542 
543 #undef INTERFACE
544 #define INTERFACE ID3D11FunctionLinkingGraph
545 
546 DECLARE_INTERFACE_(ID3D11FunctionLinkingGraph, IUnknown)
547 {
548  STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
549  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
550  STDMETHOD_(ULONG, Release)(THIS) PURE;
551 
552  // Create a shader module out of FLG description.
553  STDMETHOD(CreateModuleInstance)(THIS_ _COM_Outptr_ interface ID3D11ModuleInstance ** ppModuleInstance,
554  _Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
555 
556  STDMETHOD(SetInputSignature)(THIS_ __in_ecount(cInputParameters) const D3D11_PARAMETER_DESC * pInputParameters,
557  _In_ UINT cInputParameters,
558  _COM_Outptr_ interface ID3D11LinkingNode ** ppInputNode) PURE;
559 
560  STDMETHOD(SetOutputSignature)(THIS_ __in_ecount(cOutputParameters) const D3D11_PARAMETER_DESC * pOutputParameters,
561  _In_ UINT cOutputParameters,
562  _COM_Outptr_ interface ID3D11LinkingNode ** ppOutputNode) PURE;
563 
564  STDMETHOD(CallFunction)(THIS_ _In_opt_ LPCSTR pModuleInstanceNamespace,
565  _In_ interface ID3D11Module * pModuleWithFunctionPrototype,
566  _In_ LPCSTR pFunctionName,
567  _COM_Outptr_ interface ID3D11LinkingNode ** ppCallNode) PURE;
568 
569  STDMETHOD(PassValue)(THIS_ _In_ interface ID3D11LinkingNode * pSrcNode,
570  _In_ INT SrcParameterIndex,
571  _In_ interface ID3D11LinkingNode * pDstNode,
572  _In_ INT DstParameterIndex) PURE;
573 
574  STDMETHOD(PassValueWithSwizzle)(THIS_ _In_ interface ID3D11LinkingNode * pSrcNode,
575  _In_ INT SrcParameterIndex,
576  _In_ LPCSTR pSrcSwizzle,
577  _In_ interface ID3D11LinkingNode * pDstNode,
578  _In_ INT DstParameterIndex,
579  _In_ LPCSTR pDstSwizzle) PURE;
580 
581  STDMETHOD(GetLastError)(THIS_ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
582 
583  STDMETHOD(GenerateHlsl)(THIS_ _In_ UINT uFlags, // uFlags is reserved for future use.
584  _COM_Outptr_ ID3DBlob ** ppBuffer) PURE;
585 };
586 
587 
589 // APIs //////////////////////////////////////////////////////////////////////
591 
592 #ifdef __cplusplus
593 extern "C" {
594 #endif //__cplusplus
595 
596 #ifdef __cplusplus
597 }
598 #endif //__cplusplus
599 
600 #endif //__D3D11SHADER_H__
601 
LPCSTR Name
Definition: d3d11shader.h:220
UINT ConstantBuffers
Definition: d3d11shader.h:108
UINT TempArrayCount
Definition: d3d11shader.h:115
enum _D3D_SHADER_VARIABLE_CLASS D3D_SHADER_VARIABLE_CLASS
UINT TextureBiasInstructions
Definition: d3d11shader.h:195
D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE
Definition: d3d11shader.h:42
interface ID3D11LibraryReflection * LPD3D11LIBRARYREFLECTION
Definition: d3d11shader.h:253
struct _D3D11_LIBRARY_DESC D3D11_LIBRARY_DESC
D3D_SHADER_INPUT_TYPE Type
Definition: d3d11shader.h:150
DEFINE_GUID(IID_ID3D11ShaderReflectionType, 0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21)
UINT DclCount
Definition: d3d11shader.h:191
INT FunctionParameterCount
Definition: d3d11shader.h:212
D3D_SHADER_VARIABLE_TYPE Type
Definition: d3d11shader.h:222
UINT64 RequiredFeatureFlags
Definition: d3d11shader.h:209
LPCSTR Name
Definition: d3d11shader.h:93
__in_ecount(4) CONST FLOAT *pF
UINT Size
Definition: d3d11shader.h:75
D3D_FEATURE_LEVEL
Definition: d3dcommon.h:79
UINT PatchConstantParameters
Definition: d3d11shader.h:135
D3D_FEATURE_LEVEL MinFeatureLevel
Definition: d3d11shader.h:208
UINT cGSInstanceCount
Definition: d3d11shader.h:136
D3D_SHADER_VARIABLE_CLASS Class
Definition: d3d11shader.h:86
UINT StartSampler
Definition: d3d11shader.h:80
D3D_PARAMETER_FLAGS Flags
Definition: d3d11shader.h:227
struct _D3D11_FUNCTION_DESC D3D11_FUNCTION_DESC
UINT Members
Definition: d3d11shader.h:91
UINT BindPoint
Definition: d3d11shader.h:151
interface ID3D11FunctionParameterReflection * LPD3D11FUNCTIONPARAMETERREFLECTION
Definition: d3d11shader.h:259
D3D_CBUFFER_TYPE Type
Definition: d3d11shader.h:65
UINT Rows
Definition: d3d11shader.h:224
UINT TempRegisterCount
Definition: d3d11shader.h:188
Definition: d3d11shader.h:23
UINT TextureCompInstructions
Definition: d3d11shader.h:194
UINT DclCount
Definition: d3d11shader.h:117
LPCSTR Name
Definition: d3d11shader.h:64
D3D_PRIMITIVE
Definition: d3dcommon.h:207
UINT TextureNormalInstructions
Definition: d3d11shader.h:118
D3D_TESSELLATOR_DOMAIN TessellatorDomain
Definition: d3d11shader.h:140
D3D_TESSELLATOR_PARTITIONING
Definition: d3dcommon.h:913
interface ID3D11ShaderReflectionType ID3D11ShaderReflectionType
Definition: d3d11shader.h:240
interface DECLSPEC_UUID("6E6FFA6A-9BAE-4613-A51E-91652D508C21") ID3D11ShaderReflectionType
uint64_t UINT64
Definition: coretypes.h:8
UINT DynamicFlowControlCount
Definition: d3d11shader.h:127
D3D_SHADER_VARIABLE_CLASS Class
Definition: d3d11shader.h:223
UINT Flags
Definition: d3d11shader.h:106
D3D_TESSELLATOR_OUTPUT_PRIMITIVE
Definition: d3dcommon.h:928
D3D_NAME
Definition: d3dcommon.h:805
struct _D3D11_SHADER_TYPE_DESC D3D11_SHADER_TYPE_DESC
Definition: d3d11shader.h:102
UINT TextureSize
Definition: d3d11shader.h:79
UINT ArrayInstructionCount
Definition: d3d11shader.h:203
interface ID3D11ShaderReflection ID3D11ShaderReflection
Definition: d3d11shader.h:249
UINT Stream
Definition: d3d11shader.h:58
D3D11_SHADER_VERSION_TYPE
Definition: d3d11shader.h:16
UINT InputParameters
Definition: d3d11shader.h:110
UINT SamplerSize
Definition: d3d11shader.h:81
LPVOID DefaultValue
Definition: d3d11shader.h:77
UINT cBarrierInstructions
Definition: d3d11shader.h:142
D3D_MIN_PRECISION
Definition: d3dcommon.h:943
UINT Offset
Definition: d3d11shader.h:92
UINT Elements
Definition: d3d11shader.h:90
D3D_INTERPOLATION_MODE
Definition: d3dcommon.h:956
UINT TextureLoadInstructions
Definition: d3d11shader.h:193
LPCSTR SemanticName
Definition: d3d11shader.h:221
UINT BitwiseInstructionCount
Definition: d3d11shader.h:207
struct _D3D11_SHADER_INPUT_BIND_DESC D3D11_SHADER_INPUT_BIND_DESC
UINT MovcInstructionCount
Definition: d3d11shader.h:205
D3D_NAME SystemValueType
Definition: d3d11shader.h:50
D3D_RESOURCE_RETURN_TYPE ReturnType
Definition: d3d11shader.h:155
UINT uFlags
Definition: d3d11shader.h:68
UINT Version
Definition: d3d11shader.h:180
D3D_PRIMITIVE InputPrimitive
Definition: d3d11shader.h:134
D3D_REGISTER_COMPONENT_TYPE
Definition: d3dcommon.h:887
D3D_TESSELLATOR_DOMAIN
Definition: d3dcommon.h:900
struct _D3D11_SHADER_VARIABLE_DESC D3D11_SHADER_VARIABLE_DESC
Definition: d3d11shader.h:62
UINT ConversionInstructionCount
Definition: d3d11shader.h:206
UINT TextureNormalInstructions
Definition: d3d11shader.h:192
BOOL Has10Level9VertexShader
Definition: d3d11shader.h:214
UINT FirstOutComponent
Definition: d3d11shader.h:232
UINT cInterlockedInstructions
Definition: d3d11shader.h:143
LPCSTR Name
Definition: d3d11shader.h:149
UINT StartTexture
Definition: d3d11shader.h:78
interface ID3D11ShaderReflection * LPD3D11SHADERREFLECTION
Definition: d3d11shader.h:250
UINT Flags
Definition: d3d11shader.h:182
interface ID3D11LibraryReflection ID3D11LibraryReflection
Definition: d3d11shader.h:252
UINT BoundResources
Definition: d3d11shader.h:185
Definition: d3d11shader.h:25
UINT FunctionCount
Definition: d3d11shader.h:175
D3D_INTERPOLATION_MODE InterpolationMode
Definition: d3d11shader.h:226
Definition: d3d11shader.h:24
UINT TempRegisterCount
Definition: d3d11shader.h:114
Definition: d3d11shader.h:171
UINT BindCount
Definition: d3d11shader.h:152
UINT TextureLoadInstructions
Definition: d3d11shader.h:119
interface ID3D11FunctionParameterReflection ID3D11FunctionParameterReflection
Definition: d3d11shader.h:258
UINT CutInstructionCount
Definition: d3d11shader.h:130
Definition: d3d11shader.h:84
UINT BoundResources
Definition: d3d11shader.h:109
UINT Size
Definition: d3d11shader.h:67
D3D_SRV_DIMENSION
Definition: d3dcommon.h:294
LPCSTR Name
Definition: d3d11shader.h:211
UINT Columns
Definition: d3d11shader.h:89
Definition: d3d11shader.h:45
UINT IntInstructionCount
Definition: d3d11shader.h:124
struct _D3D11_SHADER_DESC D3D11_SHADER_DESC
interface ID3D11ShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer
Definition: d3d11shader.h:246
UINT StaticFlowControlCount
Definition: d3d11shader.h:200
UINT Flags
Definition: d3d11shader.h:174
UINT FloatInstructionCount
Definition: d3d11shader.h:197
D3D_TESSELLATOR_PARTITIONING HSPartitioning
Definition: d3d11shader.h:139
#define A(i)
Definition: ecp_curves.c:884
interface ID3D11ShaderReflectionVariable ID3D11ShaderReflectionVariable
Definition: d3d11shader.h:243
UINT cTextureStoreInstructions
Definition: d3d11shader.h:144
UINT Version
Definition: d3d11shader.h:104
UINT TextureGradientInstructions
Definition: d3d11shader.h:196
UINT MacroInstructionCount
Definition: d3d11shader.h:128
interface ID3D11ShaderReflectionType * LPD3D11SHADERREFLECTIONTYPE
Definition: d3d11shader.h:241
UINT ConstantBuffers
Definition: d3d11shader.h:184
Definition: d3d11shader.h:218
D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE
Definition: d3d11shader.h:100
enum _D3D_SHADER_INPUT_TYPE D3D_SHADER_INPUT_TYPE
interface ID3D11FunctionReflection * LPD3D11FUNCTIONREFLECTION
Definition: d3d11shader.h:256
UINT FirstInComponent
Definition: d3d11shader.h:230
UINT TextureCompInstructions
Definition: d3d11shader.h:120
Definition: d3d11shader.h:147
interface ID3D11ShaderReflectionConstantBuffer * LPD3D11SHADERREFLECTIONCONSTANTBUFFER
Definition: d3d11shader.h:247
ID3D10Blob ID3DBlob
Definition: d3dcommon.h:448
UINT FloatInstructionCount
Definition: d3d11shader.h:123
enum _D3D_CBUFFER_TYPE D3D_CBUFFER_TYPE
UINT TextureGradientInstructions
Definition: d3d11shader.h:122
Definition: d3d11shader.h:71
UINT Columns
Definition: d3d11shader.h:225
LPCSTR Creator
Definition: d3d11shader.h:181
LPCSTR Name
Definition: d3d11shader.h:73
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
UINT ArrayInstructionCount
Definition: d3d11shader.h:129
D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN
Definition: d3d11shader.h:96
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology
Definition: d3d11shader.h:132
UINT InstructionCount
Definition: d3d11shader.h:187
struct _D3D11_SIGNATURE_PARAMETER_DESC D3D11_SIGNATURE_PARAMETER_DESC
BYTE Mask
Definition: d3d11shader.h:52
unsigned int BOOL
Definition: gctypes.h:51
enum _D3D_SHADER_VARIABLE_TYPE D3D_SHADER_VARIABLE_TYPE
UINT UintInstructionCount
Definition: d3d11shader.h:199
UINT uFlags
Definition: d3d11shader.h:76
struct _D3D11_PARAMETER_DESC D3D11_PARAMETER_DESC
enum _D3D_PARAMETER_FLAGS D3D_PARAMETER_FLAGS
D3D_PRIMITIVE_TOPOLOGY
Definition: d3dcommon.h:108
UINT SemanticIndex
Definition: d3d11shader.h:48
D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive
Definition: d3d11shader.h:138
UINT cControlPoints
Definition: d3d11shader.h:137
Definition: d3d11shader.h:178
LPCSTR SemanticName
Definition: d3d11shader.h:47
UINT GSMaxOutputVertexCount
Definition: d3d11shader.h:133
DECLARE_INTERFACE(ID3D11ShaderReflectionType)
Definition: d3d11shader.h:269
UINT EmitInstructionCount
Definition: d3d11shader.h:131
Definition: glslang_tab.cpp:135
D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING
Definition: d3d11shader.h:98
D3D_RESOURCE_RETURN_TYPE
Definition: d3dcommon.h:860
LPCSTR Creator
Definition: d3d11shader.h:173
D3D_MIN_PRECISION MinPrecision
Definition: d3d11shader.h:59
UINT FirstInRegister
Definition: d3d11shader.h:229
Definition: glslang_tab.cpp:136
UINT TempArrayCount
Definition: d3d11shader.h:189
BYTE ReadWriteMask
Definition: d3d11shader.h:54
UINT DynamicFlowControlCount
Definition: d3d11shader.h:201
LPCSTR Creator
Definition: d3d11shader.h:105
UINT OutputParameters
Definition: d3d11shader.h:111
UINT IntInstructionCount
Definition: d3d11shader.h:198
interface ID3D11ShaderReflectionVariable * LPD3D11SHADERREFLECTIONVARIABLE
Definition: d3d11shader.h:244
D3D_SRV_DIMENSION Dimension
Definition: d3d11shader.h:156
_In_ D3D_ROOT_SIGNATURE_VERSION _Out_ ID3DBlob _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppErrorBlob)
Definition: d3d12.h:3374
UINT NumSamples
Definition: d3d11shader.h:157
UINT MovInstructionCount
Definition: d3d11shader.h:204
D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE
Definition: d3d11shader.h:40
BOOL HasReturn
Definition: d3d11shader.h:213
Definition: d3d11shader.h:20
struct _D3D11_SHADER_BUFFER_DESC D3D11_SHADER_BUFFER_DESC
UINT Rows
Definition: d3d11shader.h:88
UINT UintInstructionCount
Definition: d3d11shader.h:125
Definition: d3d11shader.h:18
UINT uFlags
Definition: d3d11shader.h:154
#define F(x, y, z)
UINT Variables
Definition: d3d11shader.h:66
interface ID3D11FunctionReflection ID3D11FunctionReflection
Definition: d3d11shader.h:255
UINT DefCount
Definition: d3d11shader.h:116
Definition: d3d11shader.h:19
UINT DefCount
Definition: d3d11shader.h:190
UINT FirstOutRegister
Definition: d3d11shader.h:231
BOOL Has10Level9PixelShader
Definition: d3d11shader.h:215
DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown)
Definition: d3d11shader.h:333
UINT StartOffset
Definition: d3d11shader.h:74
UINT StaticFlowControlCount
Definition: d3d11shader.h:126
UINT Register
Definition: d3d11shader.h:49
D3D_SHADER_VARIABLE_TYPE Type
Definition: d3d11shader.h:87
UINT MacroInstructionCount
Definition: d3d11shader.h:202
UINT InstructionCount
Definition: d3d11shader.h:113
UINT TextureBiasInstructions
Definition: d3d11shader.h:121
D3D_REGISTER_COMPONENT_TYPE ComponentType
Definition: d3d11shader.h:51
Definition: d3d11shader.h:27