[Mesa-dev] [PATCH 02/29] i965/surface_state: Use an identity swizzle pre-Haswell

Jason Ekstrand jason at jlekstrand.net
Sat Jan 27 01:59:31 UTC 2018


---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 6 ++++++
 1 file changed, 6 insertions(+)

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 611e850..39985f0 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -559,6 +559,12 @@ static void brw_update_texture_surface(struct gl_context *ctx,
          .usage = ISL_SURF_USAGE_TEXTURE_BIT,
       };
 
+      /* On Ivy Bridge and earlier, we handle texture swizzle with shader
+       * code.  The actual surface swizzle should be identity.
+       */
+      if (brw->gen <= 7 && !brw->is_haswell)
+         view.swizzle = ISL_SWIZZLE_IDENTITY;
+
       if (obj->Target == GL_TEXTURE_CUBE_MAP ||
           obj->Target == GL_TEXTURE_CUBE_MAP_ARRAY)
          view.usage |= ISL_SURF_USAGE_CUBE_BIT;
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list