[Mesa-dev] [PATCH 08/17] i965: Explicitly forbid rendering to integer L/A/I/LA formats.

Eric Anholt eric at anholt.net
Fri Jan 20 15:39:20 PST 2012


Once these are mapped to R/RG, they would show up as renderable thanks
to the default logic above, even though we don't have fragment shader
output swizzling for them.

NOTE: This is a candidate for the 8.0 branch.
---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |   32 ++++++++++++++++++++++
 1 files changed, 32 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 ef270e7..0296f25 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -536,6 +536,38 @@ brw_init_surface_formats(struct brw_context *brw)
       }
    }
 
+   /* These formats are not actually supported as render targets, because we use
+    * a mismatched BRW_SURFACEFORMAT, and we would need to swizzle the fragment
+    * shader output colors to make up for that.
+    */
+   brw->format_supported_as_render_target[MESA_FORMAT_ALPHA_UINT32] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_ALPHA_INT32] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_ALPHA_UINT16] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_ALPHA_INT16] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_ALPHA_UINT8] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_ALPHA_INT8] = false;
+
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_UINT32] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_INT32] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_UINT16] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_INT16] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_UINT8] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_INT8] = false;
+
+   brw->format_supported_as_render_target[MESA_FORMAT_INTENSITY_UINT32] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_INTENSITY_INT32] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_INTENSITY_UINT16] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_INTENSITY_INT16] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_INTENSITY_UINT8] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_INTENSITY_INT8] = false;
+
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_ALPHA_UINT32] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_ALPHA_INT32] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_ALPHA_UINT16] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_ALPHA_INT16] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_ALPHA_UINT8] = false;
+   brw->format_supported_as_render_target[MESA_FORMAT_LUMINANCE_ALPHA_INT8] = false;
+
    /* We will check this table for FBO completeness, but the surface format
     * table above only covered color rendering.
     */
-- 
1.7.7.3



More information about the mesa-dev mailing list