[Mesa-dev] ARB_texture_gather support for Sandy Bridge

Chris Forbes chrisf at ijw.co.nz
Mon Feb 3 10:29:29 CET 2014


This series adds a bunch of workarounds to enable ARB_texture_gather
(in its more restrictive form) on Gen6 hardware.

These are necessary because Gen6's gather4 instruction doesn't work
correctly with integer or unsigned integer formats.

The approach is:

* For 32-bit wide formats, pretend the surface is FLOAT, and reinterpret
the bits as INT/UINT. This requires only a surface format override; nothing
in the shader.

* For 8- and 16-bit wide formats, pretend the surface is UNORM,
and recover the appropriate unsigned integer value by multiplying up,
and then converting to INT/UINT. If INT is required, then fix the sign
extension of the value by the usual SHL/ASR method.

This now passes all the applicable ARB_texture_gather piglit tests.



More information about the mesa-dev mailing list