Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/directx_headers/include/directx/d3d12shader.h
9906 views
1
//////////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (c) Microsoft Corporation.
4
// Licensed under the MIT license.
5
//
6
// File: D3D12Shader.h
7
// Content: D3D12 Shader Types and APIs
8
//
9
//////////////////////////////////////////////////////////////////////////////
10
11
#ifndef __D3D12SHADER_H__
12
#define __D3D12SHADER_H__
13
14
#include "d3dcommon.h"
15
16
typedef enum D3D12_SHADER_VERSION_TYPE
17
{
18
D3D12_SHVER_PIXEL_SHADER = 0,
19
D3D12_SHVER_VERTEX_SHADER = 1,
20
D3D12_SHVER_GEOMETRY_SHADER = 2,
21
22
// D3D11 Shaders
23
D3D12_SHVER_HULL_SHADER = 3,
24
D3D12_SHVER_DOMAIN_SHADER = 4,
25
D3D12_SHVER_COMPUTE_SHADER = 5,
26
27
// D3D12 Shaders
28
D3D12_SHVER_LIBRARY = 6,
29
30
D3D12_SHVER_RAY_GENERATION_SHADER = 7,
31
D3D12_SHVER_INTERSECTION_SHADER = 8,
32
D3D12_SHVER_ANY_HIT_SHADER = 9,
33
D3D12_SHVER_CLOSEST_HIT_SHADER = 10,
34
D3D12_SHVER_MISS_SHADER = 11,
35
D3D12_SHVER_CALLABLE_SHADER = 12,
36
37
D3D12_SHVER_MESH_SHADER = 13,
38
D3D12_SHVER_AMPLIFICATION_SHADER = 14,
39
40
D3D12_SHVER_RESERVED0 = 0xFFF0,
41
} D3D12_SHADER_VERSION_TYPE;
42
43
#define D3D12_SHVER_GET_TYPE(_Version) \
44
(((_Version) >> 16) & 0xffff)
45
#define D3D12_SHVER_GET_MAJOR(_Version) \
46
(((_Version) >> 4) & 0xf)
47
#define D3D12_SHVER_GET_MINOR(_Version) \
48
(((_Version) >> 0) & 0xf)
49
50
// Slot ID for library function return
51
#define D3D_RETURN_PARAMETER_INDEX (-1)
52
53
typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE;
54
55
typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE;
56
57
58
typedef struct _D3D12_SIGNATURE_PARAMETER_DESC
59
{
60
LPCSTR SemanticName; // Name of the semantic
61
UINT SemanticIndex; // Index of the semantic
62
UINT Register; // Number of member variables
63
D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
64
D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)
65
BYTE Mask; // Mask to indicate which components of the register
66
// are used (combination of D3D10_COMPONENT_MASK values)
67
BYTE ReadWriteMask; // Mask to indicate whether a given component is
68
// never written (if this is an output signature) or
69
// always read (if this is an input signature).
70
// (combination of D3D_MASK_* values)
71
UINT Stream; // Stream index
72
D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision
73
} D3D12_SIGNATURE_PARAMETER_DESC;
74
75
typedef struct _D3D12_SHADER_BUFFER_DESC
76
{
77
LPCSTR Name; // Name of the constant buffer
78
D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
79
UINT Variables; // Number of member variables
80
UINT Size; // Size of CB (in bytes)
81
UINT uFlags; // Buffer description flags
82
} D3D12_SHADER_BUFFER_DESC;
83
84
typedef struct _D3D12_SHADER_VARIABLE_DESC
85
{
86
LPCSTR Name; // Name of the variable
87
UINT StartOffset; // Offset in constant buffer's backing store
88
UINT Size; // Size of variable (in bytes)
89
UINT uFlags; // Variable flags
90
LPVOID DefaultValue; // Raw pointer to default value
91
UINT StartTexture; // First texture index (or -1 if no textures used)
92
UINT TextureSize; // Number of texture slots possibly used.
93
UINT StartSampler; // First sampler index (or -1 if no textures used)
94
UINT SamplerSize; // Number of sampler slots possibly used.
95
} D3D12_SHADER_VARIABLE_DESC;
96
97
typedef struct _D3D12_SHADER_TYPE_DESC
98
{
99
D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
100
D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
101
UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
102
UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
103
UINT Elements; // Number of elements (0 if not an array)
104
UINT Members; // Number of members (0 if not a structure)
105
UINT Offset; // Offset from the start of structure (0 if not a structure member)
106
LPCSTR Name; // Name of type, can be NULL
107
} D3D12_SHADER_TYPE_DESC;
108
109
typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN;
110
111
typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING;
112
113
typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE;
114
115
typedef struct _D3D12_SHADER_DESC
116
{
117
UINT Version; // Shader version
118
LPCSTR Creator; // Creator string
119
UINT Flags; // Shader compilation/parse flags
120
121
UINT ConstantBuffers; // Number of constant buffers
122
UINT BoundResources; // Number of bound resources
123
UINT InputParameters; // Number of parameters in the input signature
124
UINT OutputParameters; // Number of parameters in the output signature
125
126
UINT InstructionCount; // Number of emitted instructions
127
UINT TempRegisterCount; // Number of temporary registers used
128
UINT TempArrayCount; // Number of temporary arrays used
129
UINT DefCount; // Number of constant defines
130
UINT DclCount; // Number of declarations (input + output)
131
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
132
UINT TextureLoadInstructions; // Number of texture load instructions
133
UINT TextureCompInstructions; // Number of texture comparison instructions
134
UINT TextureBiasInstructions; // Number of texture bias instructions
135
UINT TextureGradientInstructions; // Number of texture gradient instructions
136
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
137
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
138
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
139
UINT StaticFlowControlCount; // Number of static flow control instructions used
140
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
141
UINT MacroInstructionCount; // Number of macro instructions used
142
UINT ArrayInstructionCount; // Number of array instructions used
143
UINT CutInstructionCount; // Number of cut instructions used
144
UINT EmitInstructionCount; // Number of emit instructions used
145
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
146
UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
147
D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
148
UINT PatchConstantParameters; // Number of parameters in the patch constant signature
149
UINT cGSInstanceCount; // Number of Geometry shader instances
150
UINT cControlPoints; // Number of control points in the HS->DS stage
151
D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
152
D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
153
D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
154
// instruction counts
155
UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
156
UINT cInterlockedInstructions; // Number of interlocked instructions
157
UINT cTextureStoreInstructions; // Number of texture writes
158
} D3D12_SHADER_DESC;
159
160
typedef struct _D3D12_SHADER_INPUT_BIND_DESC
161
{
162
LPCSTR Name; // Name of the resource
163
D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
164
UINT BindPoint; // Starting bind point
165
UINT BindCount; // Number of contiguous bind points (for arrays)
166
167
UINT uFlags; // Input binding flags
168
D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
169
D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
170
UINT NumSamples; // Number of samples (0 if not MS texture)
171
UINT Space; // Register space
172
UINT uID; // Range ID in the bytecode
173
} D3D12_SHADER_INPUT_BIND_DESC;
174
175
#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
176
#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
177
#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
178
#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
179
#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
180
#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
181
#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
182
#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
183
#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
184
#define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200
185
#define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400
186
#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800
187
#define D3D_SHADER_REQUIRES_ROVS 0x00001000
188
#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000
189
#define D3D_SHADER_REQUIRES_WAVE_OPS 0x00004000
190
#define D3D_SHADER_REQUIRES_INT64_OPS 0x00008000
191
#define D3D_SHADER_REQUIRES_VIEW_ID 0x00010000
192
#define D3D_SHADER_REQUIRES_BARYCENTRICS 0x00020000
193
#define D3D_SHADER_REQUIRES_NATIVE_16BIT_OPS 0x00040000
194
#define D3D_SHADER_REQUIRES_SHADING_RATE 0x00080000
195
#define D3D_SHADER_REQUIRES_RAYTRACING_TIER_1_1 0x00100000
196
#define D3D_SHADER_REQUIRES_SAMPLER_FEEDBACK 0x00200000
197
#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_TYPED_RESOURCE 0x00400000
198
#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_GROUP_SHARED 0x00800000
199
#define D3D_SHADER_REQUIRES_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x01000000
200
#define D3D_SHADER_REQUIRES_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x02000000
201
#define D3D_SHADER_REQUIRES_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x04000000
202
#define D3D_SHADER_REQUIRES_WAVE_MMA 0x08000000
203
#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000
204
#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000
205
#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000
206
207
208
typedef struct _D3D12_LIBRARY_DESC
209
{
210
LPCSTR Creator; // The name of the originator of the library.
211
UINT Flags; // Compilation flags.
212
UINT FunctionCount; // Number of functions exported from the library.
213
} D3D12_LIBRARY_DESC;
214
215
typedef struct _D3D12_FUNCTION_DESC
216
{
217
UINT Version; // Shader version
218
LPCSTR Creator; // Creator string
219
UINT Flags; // Shader compilation/parse flags
220
221
UINT ConstantBuffers; // Number of constant buffers
222
UINT BoundResources; // Number of bound resources
223
224
UINT InstructionCount; // Number of emitted instructions
225
UINT TempRegisterCount; // Number of temporary registers used
226
UINT TempArrayCount; // Number of temporary arrays used
227
UINT DefCount; // Number of constant defines
228
UINT DclCount; // Number of declarations (input + output)
229
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
230
UINT TextureLoadInstructions; // Number of texture load instructions
231
UINT TextureCompInstructions; // Number of texture comparison instructions
232
UINT TextureBiasInstructions; // Number of texture bias instructions
233
UINT TextureGradientInstructions; // Number of texture gradient instructions
234
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
235
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
236
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
237
UINT StaticFlowControlCount; // Number of static flow control instructions used
238
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
239
UINT MacroInstructionCount; // Number of macro instructions used
240
UINT ArrayInstructionCount; // Number of array instructions used
241
UINT MovInstructionCount; // Number of mov instructions used
242
UINT MovcInstructionCount; // Number of movc instructions used
243
UINT ConversionInstructionCount; // Number of type conversion instructions used
244
UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used
245
D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code
246
UINT64 RequiredFeatureFlags; // Required feature flags
247
248
LPCSTR Name; // Function name
249
INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)
250
BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine
251
BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob
252
BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob
253
} D3D12_FUNCTION_DESC;
254
255
typedef struct _D3D12_PARAMETER_DESC
256
{
257
LPCSTR Name; // Parameter name.
258
LPCSTR SemanticName; // Parameter semantic name (+index).
259
D3D_SHADER_VARIABLE_TYPE Type; // Element type.
260
D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.
261
UINT Rows; // Rows are for matrix parameters.
262
UINT Columns; // Components or Columns in matrix.
263
D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.
264
D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.
265
266
UINT FirstInRegister; // The first input register for this parameter.
267
UINT FirstInComponent; // The first input register component for this parameter.
268
UINT FirstOutRegister; // The first output register for this parameter.
269
UINT FirstOutComponent; // The first output register component for this parameter.
270
} D3D12_PARAMETER_DESC;
271
272
273
//////////////////////////////////////////////////////////////////////////////
274
// Interfaces ////////////////////////////////////////////////////////////////
275
//////////////////////////////////////////////////////////////////////////////
276
277
typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType;
278
typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE;
279
280
typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable;
281
typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE;
282
283
typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer;
284
typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER;
285
286
typedef interface ID3D12ShaderReflection ID3D12ShaderReflection;
287
typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION;
288
289
typedef interface ID3D12LibraryReflection ID3D12LibraryReflection;
290
typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION;
291
292
typedef interface ID3D12FunctionReflection ID3D12FunctionReflection;
293
typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION;
294
295
typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection;
296
typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION;
297
298
299
// {E913C351-783D-48CA-A1D1-4F306284AD56}
300
interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType;
301
DEFINE_GUID(IID_ID3D12ShaderReflectionType,
302
0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56);
303
304
#undef INTERFACE
305
#define INTERFACE ID3D12ShaderReflectionType
306
307
DECLARE_INTERFACE(ID3D12ShaderReflectionType)
308
{
309
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE;
310
311
STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
312
STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
313
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
314
315
STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
316
STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE;
317
STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE;
318
STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
319
STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
320
STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
321
STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE;
322
};
323
324
// {8337A8A6-A216-444A-B2F4-314733A73AEA}
325
interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable;
326
DEFINE_GUID(IID_ID3D12ShaderReflectionVariable,
327
0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea);
328
329
#undef INTERFACE
330
#define INTERFACE ID3D12ShaderReflectionVariable
331
332
DECLARE_INTERFACE(ID3D12ShaderReflectionVariable)
333
{
334
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE;
335
336
STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE;
337
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
338
339
STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
340
};
341
342
// {C59598B4-48B3-4869-B9B1-B1618B14A8B7}
343
interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer;
344
DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer,
345
0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7);
346
347
#undef INTERFACE
348
#define INTERFACE ID3D12ShaderReflectionConstantBuffer
349
350
DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer)
351
{
352
STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE;
353
354
STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
355
STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
356
};
357
358
// The ID3D12ShaderReflection IID may change from SDK version to SDK version
359
// if the reflection API changes. This prevents new code with the new API
360
// from working with an old binary. Recompiling with the new header
361
// will pick up the new IID.
362
363
// {5A58797D-A72C-478D-8BA2-EFC6B0EFE88E}
364
interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection;
365
DEFINE_GUID(IID_ID3D12ShaderReflection,
366
0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e);
367
368
#undef INTERFACE
369
#define INTERFACE ID3D12ShaderReflection
370
371
DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown)
372
{
373
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
374
_Out_ LPVOID *ppv) PURE;
375
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
376
STDMETHOD_(ULONG, Release)(THIS) PURE;
377
378
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE;
379
380
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
381
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
382
383
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
384
_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
385
386
STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
387
_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
388
STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
389
_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
390
STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
391
_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
392
393
STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
394
395
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
396
_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
397
398
STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
399
STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
400
STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
401
STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
402
403
STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
404
STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
405
406
STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
407
STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
408
409
STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
410
_Out_opt_ UINT* pSizeX,
411
_Out_opt_ UINT* pSizeY,
412
_Out_opt_ UINT* pSizeZ) PURE;
413
414
STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
415
};
416
417
// {8E349D19-54DB-4A56-9DC9-119D87BDB804}
418
interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection;
419
DEFINE_GUID(IID_ID3D12LibraryReflection,
420
0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4);
421
422
#undef INTERFACE
423
#define INTERFACE ID3D12LibraryReflection
424
425
DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown)
426
{
427
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
428
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
429
STDMETHOD_(ULONG, Release)(THIS) PURE;
430
431
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE;
432
433
STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
434
};
435
436
// {1108795C-2772-4BA9-B2A8-D464DC7E2799}
437
interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection;
438
DEFINE_GUID(IID_ID3D12FunctionReflection,
439
0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99);
440
441
#undef INTERFACE
442
#define INTERFACE ID3D12FunctionReflection
443
444
DECLARE_INTERFACE(ID3D12FunctionReflection)
445
{
446
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE;
447
448
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
449
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
450
451
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
452
_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
453
454
STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
455
456
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
457
_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
458
459
// Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
460
STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
461
};
462
463
// {EC25F42D-7006-4F2B-B33E-02CC3375733F}
464
interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection;
465
DEFINE_GUID(IID_ID3D12FunctionParameterReflection,
466
0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f);
467
468
#undef INTERFACE
469
#define INTERFACE ID3D12FunctionParameterReflection
470
471
DECLARE_INTERFACE(ID3D12FunctionParameterReflection)
472
{
473
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE;
474
};
475
476
477
//////////////////////////////////////////////////////////////////////////////
478
// APIs //////////////////////////////////////////////////////////////////////
479
//////////////////////////////////////////////////////////////////////////////
480
481
#ifdef __cplusplus
482
extern "C" {
483
#endif //__cplusplus
484
485
#ifdef __cplusplus
486
}
487
#endif //__cplusplus
488
489
#endif //__D3D12SHADER_H__
490
491
492