
224 V 3D Engine Design
output compressed blocks from the pixel shader. The render target should be
16 times smaller than the source texture, so one texel corresponds to one BC6H
block (16 source texels). The final step is to copy the results from the temporary
render target to the destination BC6H texture using the
CopyResource function.
To achieve optimal performance, the algorithm requires a native float to half
conversion instructions, which are available in Shader Model 5. Additionally, it
is preferable to avoid integer operations altogether (especially 32-bit divides and
multiplies), as they are very costly on modern GPUs. For example, the pop-
ular ...