123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460 |
- #ifndef __D3D12SHADER_H__
- #define __D3D12SHADER_H__
- #include "d3dcommon.h"
- typedef enum D3D12_SHADER_VERSION_TYPE
- {
- D3D12_SHVER_PIXEL_SHADER = 0,
- D3D12_SHVER_VERTEX_SHADER = 1,
- D3D12_SHVER_GEOMETRY_SHADER = 2,
-
-
- D3D12_SHVER_HULL_SHADER = 3,
- D3D12_SHVER_DOMAIN_SHADER = 4,
- D3D12_SHVER_COMPUTE_SHADER = 5,
- D3D12_SHVER_RESERVED0 = 0xFFF0,
- } D3D12_SHADER_VERSION_TYPE;
- #define D3D12_SHVER_GET_TYPE(_Version) \
- (((_Version) >> 16) & 0xffff)
- #define D3D12_SHVER_GET_MAJOR(_Version) \
- (((_Version) >> 4) & 0xf)
- #define D3D12_SHVER_GET_MINOR(_Version) \
- (((_Version) >> 0) & 0xf)
- #define D3D_RETURN_PARAMETER_INDEX (-1)
- typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE;
- typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE;
- typedef struct _D3D12_SIGNATURE_PARAMETER_DESC
- {
- LPCSTR SemanticName;
- UINT SemanticIndex;
- UINT Register;
- D3D_NAME SystemValueType;
- D3D_REGISTER_COMPONENT_TYPE ComponentType;
- BYTE Mask;
-
- BYTE ReadWriteMask;
-
-
-
- UINT Stream;
- D3D_MIN_PRECISION MinPrecision;
- } D3D12_SIGNATURE_PARAMETER_DESC;
- typedef struct _D3D12_SHADER_BUFFER_DESC
- {
- LPCSTR Name;
- D3D_CBUFFER_TYPE Type;
- UINT Variables;
- UINT Size;
- UINT uFlags;
- } D3D12_SHADER_BUFFER_DESC;
- typedef struct _D3D12_SHADER_VARIABLE_DESC
- {
- LPCSTR Name;
- UINT StartOffset;
- UINT Size;
- UINT uFlags;
- LPVOID DefaultValue;
- UINT StartTexture;
- UINT TextureSize;
- UINT StartSampler;
- UINT SamplerSize;
- } D3D12_SHADER_VARIABLE_DESC;
- typedef struct _D3D12_SHADER_TYPE_DESC
- {
- D3D_SHADER_VARIABLE_CLASS Class;
- D3D_SHADER_VARIABLE_TYPE Type;
- UINT Rows;
- UINT Columns;
- UINT Elements;
- UINT Members;
- UINT Offset;
- LPCSTR Name;
- } D3D12_SHADER_TYPE_DESC;
- typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN;
- typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING;
- typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE;
- typedef struct _D3D12_SHADER_DESC
- {
- UINT Version;
- LPCSTR Creator;
- UINT Flags;
-
- UINT ConstantBuffers;
- UINT BoundResources;
- UINT InputParameters;
- UINT OutputParameters;
- UINT InstructionCount;
- UINT TempRegisterCount;
- UINT TempArrayCount;
- UINT DefCount;
- UINT DclCount;
- UINT TextureNormalInstructions;
- UINT TextureLoadInstructions;
- UINT TextureCompInstructions;
- UINT TextureBiasInstructions;
- UINT TextureGradientInstructions;
- UINT FloatInstructionCount;
- UINT IntInstructionCount;
- UINT UintInstructionCount;
- UINT StaticFlowControlCount;
- UINT DynamicFlowControlCount;
- UINT MacroInstructionCount;
- UINT ArrayInstructionCount;
- UINT CutInstructionCount;
- UINT EmitInstructionCount;
- D3D_PRIMITIVE_TOPOLOGY GSOutputTopology;
- UINT GSMaxOutputVertexCount;
- D3D_PRIMITIVE InputPrimitive;
- UINT PatchConstantParameters;
- UINT cGSInstanceCount;
- UINT cControlPoints;
- D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive;
- D3D_TESSELLATOR_PARTITIONING HSPartitioning;
- D3D_TESSELLATOR_DOMAIN TessellatorDomain;
-
- UINT cBarrierInstructions;
- UINT cInterlockedInstructions;
- UINT cTextureStoreInstructions;
- } D3D12_SHADER_DESC;
- typedef struct _D3D12_SHADER_INPUT_BIND_DESC
- {
- LPCSTR Name;
- D3D_SHADER_INPUT_TYPE Type;
- UINT BindPoint;
- UINT BindCount;
- UINT uFlags;
- D3D_RESOURCE_RETURN_TYPE ReturnType;
- D3D_SRV_DIMENSION Dimension;
- UINT NumSamples;
- UINT Space;
- UINT uID;
- } D3D12_SHADER_INPUT_BIND_DESC;
- #define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
- #define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
- #define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
- #define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
- #define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
- #define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
- #define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
- #define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
- #define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
- #define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200
- #define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400
- #define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800
- #define D3D_SHADER_REQUIRES_ROVS 0x00001000
- #define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000
- typedef struct _D3D12_LIBRARY_DESC
- {
- LPCSTR Creator;
- UINT Flags;
- UINT FunctionCount;
- } D3D12_LIBRARY_DESC;
- typedef struct _D3D12_FUNCTION_DESC
- {
- UINT Version;
- LPCSTR Creator;
- UINT Flags;
-
- UINT ConstantBuffers;
- UINT BoundResources;
- UINT InstructionCount;
- UINT TempRegisterCount;
- UINT TempArrayCount;
- UINT DefCount;
- UINT DclCount;
- UINT TextureNormalInstructions;
- UINT TextureLoadInstructions;
- UINT TextureCompInstructions;
- UINT TextureBiasInstructions;
- UINT TextureGradientInstructions;
- UINT FloatInstructionCount;
- UINT IntInstructionCount;
- UINT UintInstructionCount;
- UINT StaticFlowControlCount;
- UINT DynamicFlowControlCount;
- UINT MacroInstructionCount;
- UINT ArrayInstructionCount;
- UINT MovInstructionCount;
- UINT MovcInstructionCount;
- UINT ConversionInstructionCount;
- UINT BitwiseInstructionCount;
- D3D_FEATURE_LEVEL MinFeatureLevel;
- UINT64 RequiredFeatureFlags;
- LPCSTR Name;
- INT FunctionParameterCount;
- BOOL HasReturn;
- BOOL Has10Level9VertexShader;
- BOOL Has10Level9PixelShader;
- } D3D12_FUNCTION_DESC;
- typedef struct _D3D12_PARAMETER_DESC
- {
- LPCSTR Name;
- LPCSTR SemanticName;
- D3D_SHADER_VARIABLE_TYPE Type;
- D3D_SHADER_VARIABLE_CLASS Class;
- UINT Rows;
- UINT Columns;
- D3D_INTERPOLATION_MODE InterpolationMode;
- D3D_PARAMETER_FLAGS Flags;
- UINT FirstInRegister;
- UINT FirstInComponent;
- UINT FirstOutRegister;
- UINT FirstOutComponent;
- } D3D12_PARAMETER_DESC;
- typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType;
- typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE;
- typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable;
- typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE;
- typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer;
- typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER;
- typedef interface ID3D12ShaderReflection ID3D12ShaderReflection;
- typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION;
- typedef interface ID3D12LibraryReflection ID3D12LibraryReflection;
- typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION;
- typedef interface ID3D12FunctionReflection ID3D12FunctionReflection;
- typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION;
- typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection;
- typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION;
- interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType;
- DEFINE_GUID(IID_ID3D12ShaderReflectionType,
- 0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56);
- #undef INTERFACE
- #define INTERFACE ID3D12ShaderReflectionType
- DECLARE_INTERFACE(ID3D12ShaderReflectionType)
- {
- STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE;
-
- STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
- STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
- STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
- STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
- STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE;
- STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE;
- STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
- STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
- STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
- STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE;
- };
- interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable;
- DEFINE_GUID(IID_ID3D12ShaderReflectionVariable,
- 0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea);
- #undef INTERFACE
- #define INTERFACE ID3D12ShaderReflectionVariable
- DECLARE_INTERFACE(ID3D12ShaderReflectionVariable)
- {
- STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE;
-
- STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE;
- STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
- STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
- };
- interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer;
- DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer,
- 0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7);
- #undef INTERFACE
- #define INTERFACE ID3D12ShaderReflectionConstantBuffer
- DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer)
- {
- STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE;
-
- STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
- STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
- };
- interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection;
- DEFINE_GUID(IID_ID3D12ShaderReflection,
- 0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e);
- #undef INTERFACE
- #define INTERFACE ID3D12ShaderReflection
- DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown)
- {
- STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
- _Out_ LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE;
-
- STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
- STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
-
- STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
- _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
-
- STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
- _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
- STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
- _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
- STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
- _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
- STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
- STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
- _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
- STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
- STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
- STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
- STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
-
- STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
- STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
- STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
- STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
- STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
- _Out_opt_ UINT* pSizeX,
- _Out_opt_ UINT* pSizeY,
- _Out_opt_ UINT* pSizeZ) PURE;
- STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
- };
- interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection;
- DEFINE_GUID(IID_ID3D12LibraryReflection,
- 0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4);
- #undef INTERFACE
- #define INTERFACE ID3D12LibraryReflection
- DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown)
- {
- STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE;
-
- STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
- };
- interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection;
- DEFINE_GUID(IID_ID3D12FunctionReflection,
- 0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99);
- #undef INTERFACE
- #define INTERFACE ID3D12FunctionReflection
- DECLARE_INTERFACE(ID3D12FunctionReflection)
- {
- STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE;
-
- STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
- STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
-
- STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
- _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
-
- STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
- STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
- _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
-
- STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
- };
- interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection;
- DEFINE_GUID(IID_ID3D12FunctionParameterReflection,
- 0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f);
- #undef INTERFACE
- #define INTERFACE ID3D12FunctionParameterReflection
- DECLARE_INTERFACE(ID3D12FunctionParameterReflection)
- {
- STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE;
- };
- #ifdef __cplusplus
- extern "C" {
- #endif //__cplusplus
- #ifdef __cplusplus
- }
- #endif //__cplusplus
-
- #endif //__D3D12SHADER_H__
|