summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-01-23 12:53:17 +0100
committerMarek Olšák <[email protected]>2011-01-23 13:32:56 +0100
commit91eba2567eab9409d94efc3c1f07a4a3731d0047 (patch)
tree558c82169e170f89b50cad76f2b6d601f785e8e6 /src/gallium/drivers/r300/r300_blit.c
parentffcdd49c69811b9f768c0b32acef6527d5626a6e (diff)
r300g: support sRGB colorbuffers
We are not required to do the linear->sRGB conversion if ARB_framebuffer_sRGB is unsupported. However I think the conversion should work in hw except for blending, which matches the D3D9 behavior.
Diffstat (limited to 'src/gallium/drivers/r300/r300_blit.c')
-rw-r--r--src/gallium/drivers/r300/r300_blit.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index a43e83c0d36..e195128d263 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -411,14 +411,16 @@ static void r300_resource_copy_region(struct pipe_context *pipe,
{
enum pipe_format old_format = dst->format;
enum pipe_format new_format = old_format;
+ const struct util_format_description *desc = util_format_description(old_format);
boolean is_depth;
- if (!pipe->screen->is_format_supported(pipe->screen,
- old_format, src->target,
- src->nr_samples,
- PIPE_BIND_RENDER_TARGET |
- PIPE_BIND_SAMPLER_VIEW, 0) &&
- util_format_is_plain(old_format)) {
+ if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB ||
+ (!pipe->screen->is_format_supported(pipe->screen,
+ old_format, src->target,
+ src->nr_samples,
+ PIPE_BIND_RENDER_TARGET |
+ PIPE_BIND_SAMPLER_VIEW, 0) &&
+ desc->layout == UTIL_FORMAT_LAYOUT_PLAIN)) {
switch (util_format_get_blocksize(old_format)) {
case 1:
new_format = PIPE_FORMAT_I8_UNORM;