Graphics Reference
In-Depth Information
Figure 2.25. A visualization of a ID texture resource.
with or without mip-maps, or as an array of ID textures with or without mip-maps. The
subresource index is also visible in Figure 2.25.
Using 1D textures. One-dimensional textures are commonly used to implement lookup
tables. For example, if a very complex function can be replaced by a ID lookup texture, it
is possible to reduce the number of arithmetic instructions needed by replacing the func-
tion with a texture lookup instruction instead. Depending on the workload present in a
given shader program, this can be beneficial to the performance of the shader. In addi-
tion, since the GPU has dedicated hardware
for filtering texture data with samplers, the
filtering process is performed more or less
for free, from the shader program's point of
view. It doesn't need to perform any addi-
tional arithmetic to receive a filtered texture
value. Figure 2.26 demonstrates a complex
trigonometric function that can be replaced
by a 1D texture with the values indicated in
the image. In this type of usage, the texture
can use a single component format, such the
DXGI_FORMAT_R32_FLOAT format.
Another common use of 1D textures
is to implement a color visualization scale.
In this scenario, a 1D texture resource is
Figure 2.26. A visualization of replacing a com-
plex function with a simple lookup-table, which
is implemented as a ID texture.
Search WWH ::




Custom Search