Path: blob/master/thirdparty/directx_headers/include/directx/d3d12shader.h
9906 views
//////////////////////////////////////////////////////////////////////////////1//2// Copyright (c) Microsoft Corporation.3// Licensed under the MIT license.4//5// File: D3D12Shader.h6// Content: D3D12 Shader Types and APIs7//8//////////////////////////////////////////////////////////////////////////////910#ifndef __D3D12SHADER_H__11#define __D3D12SHADER_H__1213#include "d3dcommon.h"1415typedef enum D3D12_SHADER_VERSION_TYPE16{17D3D12_SHVER_PIXEL_SHADER = 0,18D3D12_SHVER_VERTEX_SHADER = 1,19D3D12_SHVER_GEOMETRY_SHADER = 2,2021// D3D11 Shaders22D3D12_SHVER_HULL_SHADER = 3,23D3D12_SHVER_DOMAIN_SHADER = 4,24D3D12_SHVER_COMPUTE_SHADER = 5,2526// D3D12 Shaders27D3D12_SHVER_LIBRARY = 6,2829D3D12_SHVER_RAY_GENERATION_SHADER = 7,30D3D12_SHVER_INTERSECTION_SHADER = 8,31D3D12_SHVER_ANY_HIT_SHADER = 9,32D3D12_SHVER_CLOSEST_HIT_SHADER = 10,33D3D12_SHVER_MISS_SHADER = 11,34D3D12_SHVER_CALLABLE_SHADER = 12,3536D3D12_SHVER_MESH_SHADER = 13,37D3D12_SHVER_AMPLIFICATION_SHADER = 14,3839D3D12_SHVER_RESERVED0 = 0xFFF0,40} D3D12_SHADER_VERSION_TYPE;4142#define D3D12_SHVER_GET_TYPE(_Version) \43(((_Version) >> 16) & 0xffff)44#define D3D12_SHVER_GET_MAJOR(_Version) \45(((_Version) >> 4) & 0xf)46#define D3D12_SHVER_GET_MINOR(_Version) \47(((_Version) >> 0) & 0xf)4849// Slot ID for library function return50#define D3D_RETURN_PARAMETER_INDEX (-1)5152typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE;5354typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE;555657typedef struct _D3D12_SIGNATURE_PARAMETER_DESC58{59LPCSTR SemanticName; // Name of the semantic60UINT SemanticIndex; // Index of the semantic61UINT Register; // Number of member variables62D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable63D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)64BYTE Mask; // Mask to indicate which components of the register65// are used (combination of D3D10_COMPONENT_MASK values)66BYTE ReadWriteMask; // Mask to indicate whether a given component is67// never written (if this is an output signature) or68// always read (if this is an input signature).69// (combination of D3D_MASK_* values)70UINT Stream; // Stream index71D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision72} D3D12_SIGNATURE_PARAMETER_DESC;7374typedef struct _D3D12_SHADER_BUFFER_DESC75{76LPCSTR Name; // Name of the constant buffer77D3D_CBUFFER_TYPE Type; // Indicates type of buffer content78UINT Variables; // Number of member variables79UINT Size; // Size of CB (in bytes)80UINT uFlags; // Buffer description flags81} D3D12_SHADER_BUFFER_DESC;8283typedef struct _D3D12_SHADER_VARIABLE_DESC84{85LPCSTR Name; // Name of the variable86UINT StartOffset; // Offset in constant buffer's backing store87UINT Size; // Size of variable (in bytes)88UINT uFlags; // Variable flags89LPVOID DefaultValue; // Raw pointer to default value90UINT StartTexture; // First texture index (or -1 if no textures used)91UINT TextureSize; // Number of texture slots possibly used.92UINT StartSampler; // First sampler index (or -1 if no textures used)93UINT SamplerSize; // Number of sampler slots possibly used.94} D3D12_SHADER_VARIABLE_DESC;9596typedef struct _D3D12_SHADER_TYPE_DESC97{98D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)99D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)100UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)101UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)102UINT Elements; // Number of elements (0 if not an array)103UINT Members; // Number of members (0 if not a structure)104UINT Offset; // Offset from the start of structure (0 if not a structure member)105LPCSTR Name; // Name of type, can be NULL106} D3D12_SHADER_TYPE_DESC;107108typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN;109110typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING;111112typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE;113114typedef struct _D3D12_SHADER_DESC115{116UINT Version; // Shader version117LPCSTR Creator; // Creator string118UINT Flags; // Shader compilation/parse flags119120UINT ConstantBuffers; // Number of constant buffers121UINT BoundResources; // Number of bound resources122UINT InputParameters; // Number of parameters in the input signature123UINT OutputParameters; // Number of parameters in the output signature124125UINT InstructionCount; // Number of emitted instructions126UINT TempRegisterCount; // Number of temporary registers used127UINT TempArrayCount; // Number of temporary arrays used128UINT DefCount; // Number of constant defines129UINT DclCount; // Number of declarations (input + output)130UINT TextureNormalInstructions; // Number of non-categorized texture instructions131UINT TextureLoadInstructions; // Number of texture load instructions132UINT TextureCompInstructions; // Number of texture comparison instructions133UINT TextureBiasInstructions; // Number of texture bias instructions134UINT TextureGradientInstructions; // Number of texture gradient instructions135UINT FloatInstructionCount; // Number of floating point arithmetic instructions used136UINT IntInstructionCount; // Number of signed integer arithmetic instructions used137UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used138UINT StaticFlowControlCount; // Number of static flow control instructions used139UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used140UINT MacroInstructionCount; // Number of macro instructions used141UINT ArrayInstructionCount; // Number of array instructions used142UINT CutInstructionCount; // Number of cut instructions used143UINT EmitInstructionCount; // Number of emit instructions used144D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology145UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count146D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive147UINT PatchConstantParameters; // Number of parameters in the patch constant signature148UINT cGSInstanceCount; // Number of Geometry shader instances149UINT cControlPoints; // Number of control points in the HS->DS stage150D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator151D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator152D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)153// instruction counts154UINT cBarrierInstructions; // Number of barrier instructions in a compute shader155UINT cInterlockedInstructions; // Number of interlocked instructions156UINT cTextureStoreInstructions; // Number of texture writes157} D3D12_SHADER_DESC;158159typedef struct _D3D12_SHADER_INPUT_BIND_DESC160{161LPCSTR Name; // Name of the resource162D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)163UINT BindPoint; // Starting bind point164UINT BindCount; // Number of contiguous bind points (for arrays)165166UINT uFlags; // Input binding flags167D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)168D3D_SRV_DIMENSION Dimension; // Dimension (if texture)169UINT NumSamples; // Number of samples (0 if not MS texture)170UINT Space; // Register space171UINT uID; // Range ID in the bytecode172} D3D12_SHADER_INPUT_BIND_DESC;173174#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001175#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002176#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004177#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008178#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010179#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020180#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040181#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080182#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100183#define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200184#define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400185#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800186#define D3D_SHADER_REQUIRES_ROVS 0x00001000187#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000188#define D3D_SHADER_REQUIRES_WAVE_OPS 0x00004000189#define D3D_SHADER_REQUIRES_INT64_OPS 0x00008000190#define D3D_SHADER_REQUIRES_VIEW_ID 0x00010000191#define D3D_SHADER_REQUIRES_BARYCENTRICS 0x00020000192#define D3D_SHADER_REQUIRES_NATIVE_16BIT_OPS 0x00040000193#define D3D_SHADER_REQUIRES_SHADING_RATE 0x00080000194#define D3D_SHADER_REQUIRES_RAYTRACING_TIER_1_1 0x00100000195#define D3D_SHADER_REQUIRES_SAMPLER_FEEDBACK 0x00200000196#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_TYPED_RESOURCE 0x00400000197#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_GROUP_SHARED 0x00800000198#define D3D_SHADER_REQUIRES_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x01000000199#define D3D_SHADER_REQUIRES_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x02000000200#define D3D_SHADER_REQUIRES_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x04000000201#define D3D_SHADER_REQUIRES_WAVE_MMA 0x08000000202#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000203#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000204#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000205206207typedef struct _D3D12_LIBRARY_DESC208{209LPCSTR Creator; // The name of the originator of the library.210UINT Flags; // Compilation flags.211UINT FunctionCount; // Number of functions exported from the library.212} D3D12_LIBRARY_DESC;213214typedef struct _D3D12_FUNCTION_DESC215{216UINT Version; // Shader version217LPCSTR Creator; // Creator string218UINT Flags; // Shader compilation/parse flags219220UINT ConstantBuffers; // Number of constant buffers221UINT BoundResources; // Number of bound resources222223UINT InstructionCount; // Number of emitted instructions224UINT TempRegisterCount; // Number of temporary registers used225UINT TempArrayCount; // Number of temporary arrays used226UINT DefCount; // Number of constant defines227UINT DclCount; // Number of declarations (input + output)228UINT TextureNormalInstructions; // Number of non-categorized texture instructions229UINT TextureLoadInstructions; // Number of texture load instructions230UINT TextureCompInstructions; // Number of texture comparison instructions231UINT TextureBiasInstructions; // Number of texture bias instructions232UINT TextureGradientInstructions; // Number of texture gradient instructions233UINT FloatInstructionCount; // Number of floating point arithmetic instructions used234UINT IntInstructionCount; // Number of signed integer arithmetic instructions used235UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used236UINT StaticFlowControlCount; // Number of static flow control instructions used237UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used238UINT MacroInstructionCount; // Number of macro instructions used239UINT ArrayInstructionCount; // Number of array instructions used240UINT MovInstructionCount; // Number of mov instructions used241UINT MovcInstructionCount; // Number of movc instructions used242UINT ConversionInstructionCount; // Number of type conversion instructions used243UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used244D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code245UINT64 RequiredFeatureFlags; // Required feature flags246247LPCSTR Name; // Function name248INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)249BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine250BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob251BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob252} D3D12_FUNCTION_DESC;253254typedef struct _D3D12_PARAMETER_DESC255{256LPCSTR Name; // Parameter name.257LPCSTR SemanticName; // Parameter semantic name (+index).258D3D_SHADER_VARIABLE_TYPE Type; // Element type.259D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.260UINT Rows; // Rows are for matrix parameters.261UINT Columns; // Components or Columns in matrix.262D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.263D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.264265UINT FirstInRegister; // The first input register for this parameter.266UINT FirstInComponent; // The first input register component for this parameter.267UINT FirstOutRegister; // The first output register for this parameter.268UINT FirstOutComponent; // The first output register component for this parameter.269} D3D12_PARAMETER_DESC;270271272//////////////////////////////////////////////////////////////////////////////273// Interfaces ////////////////////////////////////////////////////////////////274//////////////////////////////////////////////////////////////////////////////275276typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType;277typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE;278279typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable;280typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE;281282typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer;283typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER;284285typedef interface ID3D12ShaderReflection ID3D12ShaderReflection;286typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION;287288typedef interface ID3D12LibraryReflection ID3D12LibraryReflection;289typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION;290291typedef interface ID3D12FunctionReflection ID3D12FunctionReflection;292typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION;293294typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection;295typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION;296297298// {E913C351-783D-48CA-A1D1-4F306284AD56}299interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType;300DEFINE_GUID(IID_ID3D12ShaderReflectionType,3010xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56);302303#undef INTERFACE304#define INTERFACE ID3D12ShaderReflectionType305306DECLARE_INTERFACE(ID3D12ShaderReflectionType)307{308STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE;309310STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;311STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;312STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;313314STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;315STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE;316STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE;317STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;318STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;319STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;320STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE;321};322323// {8337A8A6-A216-444A-B2F4-314733A73AEA}324interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable;325DEFINE_GUID(IID_ID3D12ShaderReflectionVariable,3260x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea);327328#undef INTERFACE329#define INTERFACE ID3D12ShaderReflectionVariable330331DECLARE_INTERFACE(ID3D12ShaderReflectionVariable)332{333STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE;334335STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE;336STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;337338STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;339};340341// {C59598B4-48B3-4869-B9B1-B1618B14A8B7}342interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer;343DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer,3440xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7);345346#undef INTERFACE347#define INTERFACE ID3D12ShaderReflectionConstantBuffer348349DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer)350{351STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE;352353STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;354STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;355};356357// The ID3D12ShaderReflection IID may change from SDK version to SDK version358// if the reflection API changes. This prevents new code with the new API359// from working with an old binary. Recompiling with the new header360// will pick up the new IID.361362// {5A58797D-A72C-478D-8BA2-EFC6B0EFE88E}363interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection;364DEFINE_GUID(IID_ID3D12ShaderReflection,3650x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e);366367#undef INTERFACE368#define INTERFACE ID3D12ShaderReflection369370DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown)371{372STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,373_Out_ LPVOID *ppv) PURE;374STDMETHOD_(ULONG, AddRef)(THIS) PURE;375STDMETHOD_(ULONG, Release)(THIS) PURE;376377STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE;378379STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;380STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;381382STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,383_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;384385STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,386_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;387STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,388_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;389STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,390_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;391392STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;393394STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,395_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;396397STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;398STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;399STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;400STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;401402STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;403STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;404405STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;406STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;407408STDMETHOD_(UINT, GetThreadGroupSize)(THIS_409_Out_opt_ UINT* pSizeX,410_Out_opt_ UINT* pSizeY,411_Out_opt_ UINT* pSizeZ) PURE;412413STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;414};415416// {8E349D19-54DB-4A56-9DC9-119D87BDB804}417interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection;418DEFINE_GUID(IID_ID3D12LibraryReflection,4190x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4);420421#undef INTERFACE422#define INTERFACE ID3D12LibraryReflection423424DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown)425{426STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;427STDMETHOD_(ULONG, AddRef)(THIS) PURE;428STDMETHOD_(ULONG, Release)(THIS) PURE;429430STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE;431432STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;433};434435// {1108795C-2772-4BA9-B2A8-D464DC7E2799}436interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection;437DEFINE_GUID(IID_ID3D12FunctionReflection,4380x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99);439440#undef INTERFACE441#define INTERFACE ID3D12FunctionReflection442443DECLARE_INTERFACE(ID3D12FunctionReflection)444{445STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE;446447STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;448STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;449450STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,451_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;452453STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;454455STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,456_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;457458// Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.459STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;460};461462// {EC25F42D-7006-4F2B-B33E-02CC3375733F}463interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection;464DEFINE_GUID(IID_ID3D12FunctionParameterReflection,4650xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f);466467#undef INTERFACE468#define INTERFACE ID3D12FunctionParameterReflection469470DECLARE_INTERFACE(ID3D12FunctionParameterReflection)471{472STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE;473};474475476//////////////////////////////////////////////////////////////////////////////477// APIs //////////////////////////////////////////////////////////////////////478//////////////////////////////////////////////////////////////////////////////479480#ifdef __cplusplus481extern "C" {482#endif //__cplusplus483484#ifdef __cplusplus485}486#endif //__cplusplus487488#endif //__D3D12SHADER_H__489490491492