Graphics Reference
In-Depth Information
UINT uFlags;
D3D11_RES0URCE_RETURN_TYPE ReturnType;
D3D10_SRV_DIMENSION
Dimension;
UINT
NumSamples;
}
Listing 6.30. The D3D11_SHADER_INPUT_BIND_DESC structure.
Basic pieces of information about the resource binding, such as the name and type of
the resource, are available through the Name and Type members Respectively. BindPoint
indicates the slot index for singular resources, while for arrays of resources, it indi-
cates the start slot. BindCount indicates the number of resources in resource arrays. The
uFlags member can be used to determine whether a resource was manually mapped to
its slot through the register statement, and whether a sampler is a comparison sampler.
ReturnType indicates the return type that was specified as the template parameter of a
resource object, while Dimension indicates the required type of shader resource view that
can be bound for the resource. Finally, NumSamples indicates the number of samples speci-
fied as the template parameter of a Texture2DMS or Texture2DMSArray resource object.
6.9 Usingfxc.exe
The DirectX SDK includes a command-line utility named fxc.exe, which can compile
shaders and programs and effects using the same compiler provided by the D3DCompiler
DLL. While it can be used to precompile a shader program to bytecode and save it to a file
for quick loading, it can also produce some helpful diagnostic information. The simplest
way to obtain this information is to run f xc and only specify the shader profile, the entry
point, and the file name. This will cause the resulting information to be output to the com-
mand line. Listing 6.31 shows the output from fxc when compiling a pixel shader from the
LightPrepass sample project.
Microsoft (R) Direct3D Shader Compiler 9.29.952.3111
Copyright (C) Microsoft Corporation 2002-2009. All rights reserved.
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// fxc /T ps_5_0 /E PSMainPerSample LightsLP.hlsl
//
//
// Buffer Definitions:
//
Search WWH ::




Custom Search