Graphics Reference
In-Depth Information
6.7.7 Debugging Functions
HLSL debugging instrinsics, listed in Table 6.12, allow shader programs to output debug-
ging messages to the information queue.
Table 6.12. Debugging intrinsics.
6.7.8 Format Conversion Functions
The DirectX SDK includes a file named D3DX_DXGIFormatConvert.inl, which contains
a variety of inline format conversion functions. These functions are designed to be used
in a pixel shader or compute shader to convert from the raw integer representation of a
DXGI format to a vector floating point or integer format that can be used in standard shader
arithmetic. For normal read-only textures, this conversion is normally done in the hard-
ware's texture units as part of the Sample or Load operation. However, for byte-address or
structured buffer resources accessed through unordered access views, the hardware texture
units are not used, and thus the conversion needs to be performed manually in the shader.
These inline functions spare the programmer from needing to write these conversion func-
tions manually. For a full listing of all available conversion functions, consult the SDK
documentation.
6.8 Shader Reflection
Direct3D 11 provides a rich, full-featured set of APIs for programmatically querying de-
tailed information about a compiled shader program. Effective use of these APIs can enable
applications to develop sophisticated content pipelines that determine the requirements of
shader programs and prepare runtime data in a custom format. Or alternatively, it can al-
low applications to dynamically set up an appropriate runtime environment for a generic
shader program.
Search WWH ::




Custom Search