diff options
author | Marek Olšák <[email protected]> | 2012-09-14 05:34:23 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-09-14 05:55:00 +0200 |
commit | 1e51d368eb5360378218217ff35731896f48512f (patch) | |
tree | 974a06b71793bd41ed9df43413e7e2db1c42a92b /src/gallium/drivers/r300/r300_emit.c | |
parent | b33d7eaa5e77b5367584fe183c46f8c3d9a06760 (diff) |
r300g: fix colormask with non-BGRA formats
NOTE: This is a candidate for the stable branches.
Diffstat (limited to 'src/gallium/drivers/r300/r300_emit.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_emit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 4c0daa6c56d..1da6044eb87 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -45,10 +45,12 @@ void r300_emit_blend_state(struct r300_context* r300, CS_LOCALS(r300); if (fb->nr_cbufs) { - if (fb->cbufs[0]->format == PIPE_FORMAT_R16G16B16A16_FLOAT) + if (fb->cbufs[0]->format == PIPE_FORMAT_R16G16B16A16_FLOAT) { WRITE_CS_TABLE(blend->cb_noclamp, size); - else - WRITE_CS_TABLE(blend->cb_clamp, size); + } else { + unsigned swz = r300_surface(fb->cbufs[0])->colormask_swizzle; + WRITE_CS_TABLE(blend->cb_clamp[swz], size); + } } else { WRITE_CS_TABLE(blend->cb_no_readwrite, size); } |