Graphics Reference
In-Depth Information
Struct D3D11_SHADER_TYPE_DESC {
D3D1B_SHADER_VARIABLE_CLASS Class;
D3D10_SHADER_VARIABLE_TYPE Type;
UINT
Rows;
UINT
Columns;
UINT
Elements;
UINT
Members;
UINT
Offset;
}
Listing 6.28. The D3D11_SHADER_TYPE_DESC structure.
The Class member of the D3D11_SHADER_TYPE_DESC structure indicates whether
the variable is a scalar, a vector, a matrix, a resource object, a structure, a class, or an
interface pointer. The Type member indicates the primitive type of a scalar, vector, or ma-
trix variable (float, uint, double, etc.). For resource objects it indicates the resource type,
such as Texture2D, Buffer, AppendStructuredBuffer, or others. The Rows and Columns
members indicates the number of rows and columns for a matrix variable, or are set to 1
for other numeric types. Elements contains the number of elements in array types, while
Members contains the number of members for structure or class types. Offset contains the
number of bytes from a parent structure.
The ID3DllShaderReflectionType interface also contains a variety of methods that
can be used to determine the full inheritance tree for interface or class types. These include
a method for querying the base class type, a method for querying all supported interfaces,
and a method for querying whether a class implements an interface. The interface also
contains GetMemberTypeByName and GetMemberTypeBylndex methods for obtaining the
ID3DllShaderReflectionType interfaces for all members in a structure or class.
6.8.5 Input/Output Signature
The ID3DllShaderReflection interface provides a means of querying the full input and
output signatures for a shader program. Such information can be important when match-
ing a shader program from one pipeline stage to a shader program for another stage, or
when matching a vertex buffer to a vertex shader. Obtaining the input signature is done
by calling GetInputParameterDesc for each input parameter (the number of input and
output parameters is available as part of the D3D11_SHADER_DESC structure), and calling
GetOutputParameterDesc for each output parameter. Both methods return a D3D11_
SIGNATURE_PARAMETER_DESC structure, which contains information about the parameter.
The declaration for this structure is available in Listing 6.29.
Search WWH ::




Custom Search