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.
This commit is contained in:
@@ -357,10 +357,11 @@ sp_flush_tile(struct softpipe_tile_cache* tc, unsigned pos)
|
|||||||
tc->entries[pos]->data.depth32, 0/*STRIDE*/);
|
tc->entries[pos]->data.depth32, 0/*STRIDE*/);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pipe_put_tile_rgba(tc->pipe, tc->transfer,
|
pipe_put_tile_rgba_format(tc->pipe, tc->transfer,
|
||||||
tc->tile_addrs[pos].bits.x * TILE_SIZE,
|
tc->tile_addrs[pos].bits.x * TILE_SIZE,
|
||||||
tc->tile_addrs[pos].bits.y * TILE_SIZE,
|
tc->tile_addrs[pos].bits.y * TILE_SIZE,
|
||||||
TILE_SIZE, TILE_SIZE,
|
TILE_SIZE, TILE_SIZE,
|
||||||
|
tc->surface->format,
|
||||||
(float *) tc->entries[pos]->data.color);
|
(float *) tc->entries[pos]->data.color);
|
||||||
}
|
}
|
||||||
tc->tile_addrs[pos].bits.invalid = 1; /* mark as empty */
|
tc->tile_addrs[pos].bits.invalid = 1; /* mark as empty */
|
||||||
@@ -468,10 +469,11 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc,
|
|||||||
tile->data.depth32, 0/*STRIDE*/);
|
tile->data.depth32, 0/*STRIDE*/);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pipe_put_tile_rgba(tc->pipe, pt,
|
pipe_put_tile_rgba_format(tc->pipe, pt,
|
||||||
tc->tile_addrs[pos].bits.x * TILE_SIZE,
|
tc->tile_addrs[pos].bits.x * TILE_SIZE,
|
||||||
tc->tile_addrs[pos].bits.y * TILE_SIZE,
|
tc->tile_addrs[pos].bits.y * TILE_SIZE,
|
||||||
TILE_SIZE, TILE_SIZE,
|
TILE_SIZE, TILE_SIZE,
|
||||||
|
tc->surface->format,
|
||||||
(float *) tile->data.color);
|
(float *) tile->data.color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user