[Mesa-dev] [PATCH] __DRIimage: Add formats with implied swizzling

Eric Anholt eric at anholt.net
Wed Jul 18 09:02:36 PDT 2012


Kristian Høgsberg <krh at bitplanet.net> writes:

> When we sample U and V from YUYV buffers, U and V ends up in G and A
> in the shader.  Instead of pushing this to the application, just swizzle
> U and V to R and G and set B to 0 and A to 1.

Those fields are controlled by EXT_texture_swizzle.  We probably
shouldn't mess with the defaults of GL state.

Other nastiness where we're hiding the actual format from the user for
GL's depth sampling has been done with a switch in
brw_populate_sampler_prog_key_data().  But if we're actually just doing
RGBA underneath, it seems like suggesting to people that they sample
RGBA and swizzle in their shaders would avoid code and be reasonable.
It's what GL resolved for the depth sampling, we just still support GL
2.0.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120718/abcf60b9/attachment.pgp>


More information about the mesa-dev mailing list