[Mesa-dev] [PATCH] gen6-gen7: disable dithering for GL_RGB10_A2 render buffers
Jordan Justen
jordan.l.justen at intel.com
Fri Mar 14 11:15:16 PDT 2014
With only 2 bits available, dithering causes undesirable results
for RGB10_A2 render targets.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74700
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
Tested on Haswell.
We likely need a change for gen8 too. I'll work with Ken on this.
src/mesa/drivers/dri/i965/gen6_cc.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c
index 45c926c..c99ee12 100644
--- a/src/mesa/drivers/dri/i965/gen6_cc.c
+++ b/src/mesa/drivers/dri/i965/gen6_cc.c
@@ -63,13 +63,17 @@ gen6_upload_blend_state(struct brw_context *brw)
for (b = 0; b < nr_draw_buffers; b++) {
/* _NEW_BUFFERS */
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[b];
+ GLenum rb_internal_format;
GLenum rb_type;
bool integer;
- if (rb)
+ if (rb) {
rb_type = _mesa_get_format_datatype(rb->Format);
- else
+ rb_internal_format = rb->InternalFormat;
+ } else {
rb_type = GL_UNSIGNED_NORMALIZED;
+ rb_internal_format = GL_NONE;
+ }
/* Used for implementing the following bit of GL_EXT_texture_integer:
* "Per-fragment operations that require floating-point color
@@ -179,7 +183,8 @@ gen6_upload_blend_state(struct brw_context *brw)
}
/* _NEW_COLOR */
- if (ctx->Color.DitherFlag && !integer) {
+ if (ctx->Color.DitherFlag && !integer &&
+ rb_internal_format != GL_RGB10_A2) {
blend[b].blend1.dither_enable = 1;
blend[b].blend1.y_dither_offset = 0;
blend[b].blend1.x_dither_offset = 0;
--
1.9.rc1
More information about the mesa-dev
mailing list