
188 GPGPU Programming for Games and Science
// Return the repackaged input . Although we already know the uint
// values are the same as extracted , this code shows how to
// reinterpret ’ float ’ and ’double ’ values .
asuint (pid , pidLoEncoding , pidHiEncoding);
pifEncoding = asuint ( pif );
uint4 outValue ;
outValue . x = pidLoEncoding ;
outValue .y = pidHiEncoding;
outValue .z = pifEncoding;
outValue .w = minusOneEncoding | (a << 16) | (b << 24);
output . Store4 (0 , outValue );
}
LISTING 4.35: The HLSL file for the RawBuffers sample application.
The byte-address buffer HLSL objects have
Load* functions to read data
from the buffer. The
Load4(i) function