Mesa (master): i965: Don't allow rendering to non-GL_RED/RG/ RGBA integer textures.

Eric Anholt anholt at kemper.freedesktop.org
Fri Jan 27 20:07:28 UTC 2012


Module: Mesa
Branch: master
Commit: 3a8cf3357abb50d4ee11cfb801f965e3df7592fb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a8cf3357abb50d4ee11cfb801f965e3df7592fb

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jan 24 16:32:36 2012 -0800

i965: Don't allow rendering to non-GL_RED/RG/RGBA integer textures.

Fixes piglit EXT_texture_integer/fbo-blending.

---

 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index bdce057..51d3a46 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -563,6 +563,17 @@ brw_render_target_supported(struct intel_context *intel,
    struct brw_context *brw = brw_context(&intel->ctx);
    gl_format format = rb->Format;
 
+   /* Many integer formats are promoted to RGBA (like XRGB8888 is), which means
+    * we would consider them renderable even though we don't have surface
+    * support for their alpha behavior and don't have the blending unit
+    * available to fake it like we do for XRGB8888.  Force them to being
+    * unsupported.
+    */
+   if ((rb->_BaseFormat != GL_RGBA &&
+	rb->_BaseFormat != GL_RG &&
+	rb->_BaseFormat != GL_RED) && _mesa_is_format_integer_color(format))
+      return false;
+
    return brw->format_supported_as_render_target[format];
 }
 




More information about the mesa-commit mailing list