Reducing texture sampling

Texture sampling is at the core of all memory bandwidth costs. The fewer textures we use, and the smaller we make them, the better. The more we use, the more cache misses we are likely to invoke, and the larger they are, the more memory bandwidth is consumed transferring them to the texture cache. Such situations should be simplified as much as possible to avoid severe GPU bottlenecks.

Even worse, sampling textures in a non-sequential order would likely result in some very costly cache misses for the GPU to suffer through. So, if this is being done, then the texture should be reordered so that it can be sampled in a more sequential order. For example, if we're sampling by inverting the x and y coordinates (for example, tex2D(y, x) instead of tex2D(x, y)), the texture lookup would iterate through the texture vertically, then horizontally, inflicting a cache-miss almost every iteration. A lot of performance could be saved by simply rotating the texture file data and performing a sample in the correct order (tex2D(x,y)).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.218.215