
536 VII 3D Engine Design
output, as we described in Section 3.4.3, to capture texture data into a buffer
using a vertex shader. Direct3D’s constraints on stream output notably lack
support for some data types, making this quite challenging. Compute shaders
also offer a promising and elegant solution. Since we are limited to supporting
Shader Model 4 as a minimum, we unfortunately couldn’t rely on compute shaders
in all cases.
More problems arise from the different requirements GL and Direct3D 11
both enforce on the data packing after the asynchronous copy step. GL gives a
set of fine-grained pack parameters, which control how the pixel data packs into
the ...