i965/surface_state: Use an identity swizzle pre-Haswell
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 9 Feb 2017 22:50:01 +0000 (14:50 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 9 May 2018 18:16:33 +0000 (11:16 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index 96c93a7e5bf706b6278899108ffc0ab9f0c10660..67438b0f7e3269c90cd633da3e1e2150c37a9ec5 100644 (file)
@@ -592,6 +592,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 (devinfo->gen <= 7 && !devinfo->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;