/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ // Original file Copyright Crytek GMBH or its affiliates, used under license. // Description : Contains portable definition of structs and enums to match // those in D3D11Shader.h in the DirectX SDK #ifndef __DXGL_D3D11Shader_h__ #define __DXGL_D3D11Shader_h__ #include "DXGL_D3DCommon.h" //////////////////////////////////////////////////////////////////////////// // Structs //////////////////////////////////////////////////////////////////////////// typedef struct _D3D11_SIGNATURE_PARAMETER_DESC { LPCSTR SemanticName; // Name of the semantic UINT SemanticIndex; // Index of the semantic UINT Register; // Number of member variables D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable D3D_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.) BYTE Mask; // Mask to indicate which components of the register // are used (combination of D3D10_COMPONENT_MASK values) BYTE ReadWriteMask; // Mask to indicate whether a given component is // never written (if this is an output signature) or // always read (if this is an input signature). // (combination of D3D10_COMPONENT_MASK values) UINT Stream; // Stream index D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision } D3D11_SIGNATURE_PARAMETER_DESC; typedef struct _D3D11_SHADER_BUFFER_DESC { LPCSTR Name; // Name of the constant buffer D3D_CBUFFER_TYPE Type; // Indicates type of buffer content UINT Variables; // Number of member variables UINT Size; // Size of CB (in bytes) UINT uFlags; // Buffer description flags } D3D11_SHADER_BUFFER_DESC; typedef struct _D3D11_SHADER_VARIABLE_DESC { LPCSTR Name; // Name of the variable UINT StartOffset; // Offset in constant buffer's backing store UINT Size; // Size of variable (in bytes) UINT uFlags; // Variable flags LPVOID DefaultValue; // Raw pointer to default value UINT StartTexture; // First texture index (or -1 if no textures used) UINT TextureSize; // Number of texture slots possibly used. UINT StartSampler; // First sampler index (or -1 if no textures used) UINT SamplerSize; // Number of sampler slots possibly used. } D3D11_SHADER_VARIABLE_DESC; typedef struct _D3D11_SHADER_TYPE_DESC { D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.) D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.) UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable) UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable) UINT Elements; // Number of elements (0 if not an array) UINT Members; // Number of members (0 if not a structure) UINT Offset; // Offset from the start of structure (0 if not a structure member) LPCSTR Name; // Name of type, can be NULL } D3D11_SHADER_TYPE_DESC; typedef struct _D3D11_SHADER_DESC { UINT Version; // Shader version LPCSTR Creator; // Creator string UINT Flags; // Shader compilation/parse flags UINT ConstantBuffers; // Number of constant buffers UINT BoundResources; // Number of bound resources UINT InputParameters; // Number of parameters in the input signature UINT OutputParameters; // Number of parameters in the output signature UINT InstructionCount; // Number of emitted instructions UINT TempRegisterCount; // Number of temporary registers used UINT TempArrayCount; // Number of temporary arrays used UINT DefCount; // Number of constant defines UINT DclCount; // Number of declarations (input + output) UINT TextureNormalInstructions; // Number of non-categorized texture instructions UINT TextureLoadInstructions; // Number of texture load instructions UINT TextureCompInstructions; // Number of texture comparison instructions UINT TextureBiasInstructions; // Number of texture bias instructions UINT TextureGradientInstructions; // Number of texture gradient instructions UINT FloatInstructionCount; // Number of floating point arithmetic instructions used UINT IntInstructionCount; // Number of signed integer arithmetic instructions used UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used UINT StaticFlowControlCount; // Number of static flow control instructions used UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used UINT MacroInstructionCount; // Number of macro instructions used UINT ArrayInstructionCount; // Number of array instructions used UINT CutInstructionCount; // Number of cut instructions used UINT EmitInstructionCount; // Number of emit instructions used D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive UINT PatchConstantParameters; // Number of parameters in the patch constant signature UINT cGSInstanceCount; // Number of Geometry shader instances UINT cControlPoints; // Number of control points in the HS->DS stage D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline) // instruction counts UINT cBarrierInstructions; // Number of barrier instructions in a compute shader UINT cInterlockedInstructions; // Number of interlocked instructions UINT cTextureStoreInstructions; // Number of texture writes } D3D11_SHADER_DESC; typedef struct _D3D11_SHADER_INPUT_BIND_DESC { LPCSTR Name; // Name of the resource D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.) UINT BindPoint; // Starting bind point UINT BindCount; // Number of contiguous bind points (for arrays) UINT uFlags; // Input binding flags D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture) D3D_SRV_DIMENSION Dimension; // Dimension (if texture) UINT NumSamples; // Number of samples (0 if not MS texture) } D3D11_SHADER_INPUT_BIND_DESC; #endif //__DXGL_D3D11Shader_h__