I came across a problem when one of my hlsl shaders requires multiple texture searches per pixel. My 2-dimensional textures are fixed at 256 * 256, so in order to access any given texel with this limitation in mind, two bytes should be enough. My idea is to put two xy coordinates in each float, giving me eight xy coordinates in the pixel space when they are packed in a Vector4 format image. These eight coordinates are then used to select another texture (s).
The reason for this is the preservation of graphic memory and an attempt to optimize the processing time, since then I do not need to repeatedly search for textures.
By the way: does anyone know if encoding / decoding 16 bytes from / to 4 floats using 1 sample is slower than 4 samples with non-encoded data?
Edit: this is for Shader Model 3
source
share