softpipe: pass surface format to get/put_tile functions
authorBrian Paul <brianp@vmware.com>
Sun, 23 Jan 2011 00:18:53 +0000 (17:18 -0700)
committerBrian Paul <brianp@vmware.com>
Sun, 23 Jan 2011 01:33:35 +0000 (18:33 -0700)
commit4c9ad084c1f54d83b4f27ce2b4cec23b6c7371c8
tree02aceea0e53e73b98ec12e6d1138a849415c45cd
parente75844b4e09cbbfca159a4e4709d3ca1249d784d
softpipe: pass surface format to get/put_tile functions

When we read/write image tiles we need to use the format specified
in the pipe_surface, not the pipe_transfer format (which comes from
the underlying texture/resource format).

This comes up when rendering to sRGB surfaces (via OpenGL render to
texture).  Ignoring the new GL_ARB/EXT_framebuffer_sRGB extension
for now, when we render to a sRGB surface we need to treat it like
a regular, linear colorspace RGB surface.  Before, when we read/wrote
tiles to sRGB surfaces we were inadvertantly doing the color space
conversion.
src/gallium/drivers/softpipe/sp_tile_cache.c