Path: blob/master/thirdparty/directx_headers/include/directx/d3d12shader.h
21648 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_NODE_SHADER = 15,4041D3D12_SHVER_RESERVED0 = 0xFFF0,42} D3D12_SHADER_VERSION_TYPE;4344#define D3D12_SHVER_GET_TYPE(_Version) \45(((_Version) >> 16) & 0xffff)46#define D3D12_SHVER_GET_MAJOR(_Version) \47(((_Version) >> 4) & 0xf)48#define D3D12_SHVER_GET_MINOR(_Version) \49(((_Version) >> 0) & 0xf)5051// Slot ID for library function return52#define D3D_RETURN_PARAMETER_INDEX (-1)5354typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE;5556typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE;575859typedef struct _D3D12_SIGNATURE_PARAMETER_DESC60{61LPCSTR SemanticName; // Name of the semantic62UINT SemanticIndex; // Index of the semantic63UINT Register; // Number of member variables64D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable65D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)66BYTE Mask; // Mask to indicate which components of the register67// are used (combination of D3D10_COMPONENT_MASK values)68BYTE ReadWriteMask; // Mask to indicate whether a given component is69// never written (if this is an output signature) or70// always read (if this is an input signature).71// (combination of D3D_MASK_* values)72UINT Stream; // Stream index73D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision74} D3D12_SIGNATURE_PARAMETER_DESC;7576typedef struct _D3D12_SHADER_BUFFER_DESC77{78LPCSTR Name; // Name of the constant buffer79D3D_CBUFFER_TYPE Type; // Indicates type of buffer content80UINT Variables; // Number of member variables81UINT Size; // Size of CB (in bytes)82UINT uFlags; // Buffer description flags83} D3D12_SHADER_BUFFER_DESC;8485typedef struct _D3D12_SHADER_VARIABLE_DESC86{87LPCSTR Name; // Name of the variable88UINT StartOffset; // Offset in constant buffer's backing store89UINT Size; // Size of variable (in bytes)90UINT uFlags; // Variable flags91LPVOID DefaultValue; // Raw pointer to default value92UINT StartTexture; // First texture index (or -1 if no textures used)93UINT TextureSize; // Number of texture slots possibly used.94UINT StartSampler; // First sampler index (or -1 if no textures used)95UINT SamplerSize; // Number of sampler slots possibly used.96} D3D12_SHADER_VARIABLE_DESC;9798typedef struct _D3D12_SHADER_TYPE_DESC99{100D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)101D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)102UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)103UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)104UINT Elements; // Number of elements (0 if not an array)105UINT Members; // Number of members (0 if not a structure)106UINT Offset; // Offset from the start of structure (0 if not a structure member)107LPCSTR Name; // Name of type, can be NULL108} D3D12_SHADER_TYPE_DESC;109110typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN;111112typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING;113114typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE;115116typedef struct _D3D12_SHADER_DESC117{118UINT Version; // Shader version119LPCSTR Creator; // Creator string120UINT Flags; // Shader compilation/parse flags121122UINT ConstantBuffers; // Number of constant buffers123UINT BoundResources; // Number of bound resources124UINT InputParameters; // Number of parameters in the input signature125UINT OutputParameters; // Number of parameters in the output signature126127UINT InstructionCount; // Number of emitted instructions128UINT TempRegisterCount; // Number of temporary registers used129UINT TempArrayCount; // Number of temporary arrays used130UINT DefCount; // Number of constant defines131UINT DclCount; // Number of declarations (input + output)132UINT TextureNormalInstructions; // Number of non-categorized texture instructions133UINT TextureLoadInstructions; // Number of texture load instructions134UINT TextureCompInstructions; // Number of texture comparison instructions135UINT TextureBiasInstructions; // Number of texture bias instructions136UINT TextureGradientInstructions; // Number of texture gradient instructions137UINT FloatInstructionCount; // Number of floating point arithmetic instructions used138UINT IntInstructionCount; // Number of signed integer arithmetic instructions used139UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used140UINT StaticFlowControlCount; // Number of static flow control instructions used141UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used142UINT MacroInstructionCount; // Number of macro instructions used143UINT ArrayInstructionCount; // Number of array instructions used144UINT CutInstructionCount; // Number of cut instructions used145UINT EmitInstructionCount; // Number of emit instructions used146D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology147UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count148D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive149UINT PatchConstantParameters; // Number of parameters in the patch constant signature150UINT cGSInstanceCount; // Number of Geometry shader instances151UINT cControlPoints; // Number of control points in the HS->DS stage152D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator153D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator154D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)155// instruction counts156UINT cBarrierInstructions; // Number of barrier instructions in a compute shader157UINT cInterlockedInstructions; // Number of interlocked instructions158UINT cTextureStoreInstructions; // Number of texture writes159} D3D12_SHADER_DESC;160161typedef struct _D3D12_SHADER_INPUT_BIND_DESC162{163LPCSTR Name; // Name of the resource164D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)165UINT BindPoint; // Starting bind point166UINT BindCount; // Number of contiguous bind points (for arrays)167168UINT uFlags; // Input binding flags169D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)170D3D_SRV_DIMENSION Dimension; // Dimension (if texture)171UINT NumSamples; // Number of samples (0 if not MS texture)172UINT Space; // Register space173UINT uID; // Range ID in the bytecode174} D3D12_SHADER_INPUT_BIND_DESC;175176#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001177#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002178#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004179#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008180#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010181#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020182#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040183#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080184#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100185#define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200186#define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400187#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800188#define D3D_SHADER_REQUIRES_ROVS 0x00001000189#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000190#define D3D_SHADER_REQUIRES_WAVE_OPS 0x00004000191#define D3D_SHADER_REQUIRES_INT64_OPS 0x00008000192#define D3D_SHADER_REQUIRES_VIEW_ID 0x00010000193#define D3D_SHADER_REQUIRES_BARYCENTRICS 0x00020000194#define D3D_SHADER_REQUIRES_NATIVE_16BIT_OPS 0x00040000195#define D3D_SHADER_REQUIRES_SHADING_RATE 0x00080000196#define D3D_SHADER_REQUIRES_RAYTRACING_TIER_1_1 0x00100000197#define D3D_SHADER_REQUIRES_SAMPLER_FEEDBACK 0x00200000198#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_TYPED_RESOURCE 0x00400000199#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_GROUP_SHARED 0x00800000200#define D3D_SHADER_REQUIRES_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x01000000201#define D3D_SHADER_REQUIRES_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x02000000202#define D3D_SHADER_REQUIRES_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x04000000203#define D3D_SHADER_REQUIRES_WAVE_MMA 0x08000000204#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000205#define D3D_SHADER_REQUIRES_ADVANCED_TEXTURE_OPS 0x20000000206#define D3D_SHADER_REQUIRES_WRITEABLE_MSAA_TEXTURES 0x40000000207#define D3D_SHADER_REQUIRES_SAMPLE_CMP_GRADIENT_OR_BIAS 0x80000000208#define D3D_SHADER_REQUIRES_EXTENDED_COMMAND_INFO 0x100000000ull209210211typedef struct _D3D12_LIBRARY_DESC212{213LPCSTR Creator; // The name of the originator of the library.214UINT Flags; // Compilation flags.215UINT FunctionCount; // Number of functions exported from the library.216} D3D12_LIBRARY_DESC;217218typedef struct _D3D12_FUNCTION_DESC219{220UINT Version; // Shader version221LPCSTR Creator; // Creator string222UINT Flags; // Shader compilation/parse flags223224UINT ConstantBuffers; // Number of constant buffers225UINT BoundResources; // Number of bound resources226227UINT InstructionCount; // Number of emitted instructions228UINT TempRegisterCount; // Number of temporary registers used229UINT TempArrayCount; // Number of temporary arrays used230UINT DefCount; // Number of constant defines231UINT DclCount; // Number of declarations (input + output)232UINT TextureNormalInstructions; // Number of non-categorized texture instructions233UINT TextureLoadInstructions; // Number of texture load instructions234UINT TextureCompInstructions; // Number of texture comparison instructions235UINT TextureBiasInstructions; // Number of texture bias instructions236UINT TextureGradientInstructions; // Number of texture gradient instructions237UINT FloatInstructionCount; // Number of floating point arithmetic instructions used238UINT IntInstructionCount; // Number of signed integer arithmetic instructions used239UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used240UINT StaticFlowControlCount; // Number of static flow control instructions used241UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used242UINT MacroInstructionCount; // Number of macro instructions used243UINT ArrayInstructionCount; // Number of array instructions used244UINT MovInstructionCount; // Number of mov instructions used245UINT MovcInstructionCount; // Number of movc instructions used246UINT ConversionInstructionCount; // Number of type conversion instructions used247UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used248D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code249UINT64 RequiredFeatureFlags; // Required feature flags250251LPCSTR Name; // Function name252INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)253BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine254BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob255BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob256} D3D12_FUNCTION_DESC;257258typedef struct _D3D12_PARAMETER_DESC259{260LPCSTR Name; // Parameter name.261LPCSTR SemanticName; // Parameter semantic name (+index).262D3D_SHADER_VARIABLE_TYPE Type; // Element type.263D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.264UINT Rows; // Rows are for matrix parameters.265UINT Columns; // Components or Columns in matrix.266D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.267D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.268269UINT FirstInRegister; // The first input register for this parameter.270UINT FirstInComponent; // The first input register component for this parameter.271UINT FirstOutRegister; // The first output register for this parameter.272UINT FirstOutComponent; // The first output register component for this parameter.273} D3D12_PARAMETER_DESC;274275276//////////////////////////////////////////////////////////////////////////////277// Interfaces ////////////////////////////////////////////////////////////////278//////////////////////////////////////////////////////////////////////////////279280typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType;281typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE;282283typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable;284typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE;285286typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer;287typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER;288289typedef interface ID3D12ShaderReflection ID3D12ShaderReflection;290typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION;291292typedef interface ID3D12LibraryReflection ID3D12LibraryReflection;293typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION;294295typedef interface ID3D12FunctionReflection ID3D12FunctionReflection;296typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION;297298typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection;299typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION;300301302// {E913C351-783D-48CA-A1D1-4F306284AD56}303interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType;304DEFINE_GUID(IID_ID3D12ShaderReflectionType,3050xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56);306307#undef INTERFACE308#define INTERFACE ID3D12ShaderReflectionType309310DECLARE_INTERFACE(ID3D12ShaderReflectionType)311{312STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE;313314STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;315STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;316STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;317318STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;319STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE;320STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE;321STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;322STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;323STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;324STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE;325};326327// {8337A8A6-A216-444A-B2F4-314733A73AEA}328interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable;329DEFINE_GUID(IID_ID3D12ShaderReflectionVariable,3300x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea);331332#undef INTERFACE333#define INTERFACE ID3D12ShaderReflectionVariable334335DECLARE_INTERFACE(ID3D12ShaderReflectionVariable)336{337STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE;338339STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE;340STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;341342STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;343};344345// {C59598B4-48B3-4869-B9B1-B1618B14A8B7}346interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer;347DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer,3480xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7);349350#undef INTERFACE351#define INTERFACE ID3D12ShaderReflectionConstantBuffer352353DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer)354{355STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE;356357STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;358STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;359};360361// The ID3D12ShaderReflection IID may change from SDK version to SDK version362// if the reflection API changes. This prevents new code with the new API363// from working with an old binary. Recompiling with the new header364// will pick up the new IID.365366// {5A58797D-A72C-478D-8BA2-EFC6B0EFE88E}367interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection;368DEFINE_GUID(IID_ID3D12ShaderReflection,3690x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e);370371#undef INTERFACE372#define INTERFACE ID3D12ShaderReflection373374DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown)375{376STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,377_Out_ LPVOID *ppv) PURE;378STDMETHOD_(ULONG, AddRef)(THIS) PURE;379STDMETHOD_(ULONG, Release)(THIS) PURE;380381STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE;382383STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;384STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;385386STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,387_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;388389STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,390_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;391STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,392_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;393STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,394_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;395396STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;397398STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,399_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;400401STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;402STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;403STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;404STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;405406STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;407STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;408409STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;410STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;411412STDMETHOD_(UINT, GetThreadGroupSize)(THIS_413_Out_opt_ UINT* pSizeX,414_Out_opt_ UINT* pSizeY,415_Out_opt_ UINT* pSizeZ) PURE;416417STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;418};419420// {8E349D19-54DB-4A56-9DC9-119D87BDB804}421interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection;422DEFINE_GUID(IID_ID3D12LibraryReflection,4230x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4);424425#undef INTERFACE426#define INTERFACE ID3D12LibraryReflection427428DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown)429{430STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;431STDMETHOD_(ULONG, AddRef)(THIS) PURE;432STDMETHOD_(ULONG, Release)(THIS) PURE;433434STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE;435436STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;437};438439// {1108795C-2772-4BA9-B2A8-D464DC7E2799}440interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection;441DEFINE_GUID(IID_ID3D12FunctionReflection,4420x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99);443444#undef INTERFACE445#define INTERFACE ID3D12FunctionReflection446447DECLARE_INTERFACE(ID3D12FunctionReflection)448{449STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE;450451STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;452STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;453454STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,455_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;456457STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;458459STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,460_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;461462// Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.463STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;464};465466// {EC25F42D-7006-4F2B-B33E-02CC3375733F}467interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection;468DEFINE_GUID(IID_ID3D12FunctionParameterReflection,4690xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f);470471#undef INTERFACE472#define INTERFACE ID3D12FunctionParameterReflection473474DECLARE_INTERFACE(ID3D12FunctionParameterReflection)475{476STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE;477};478479480//////////////////////////////////////////////////////////////////////////////481// APIs //////////////////////////////////////////////////////////////////////482//////////////////////////////////////////////////////////////////////////////483484#ifdef __cplusplus485extern "C" {486#endif //__cplusplus487488#ifdef __cplusplus489}490#endif //__cplusplus491492#endif //__D3D12SHADER_H__493494495496497