From 23d703de1fb140bb2ed4da247961d89a69f27140 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 9 Feb 2017 14:50:01 -0800 Subject: [PATCH] i965/surface_state: Use an identity swizzle pre-Haswell Reviewed-by: Kenneth Graunke --- 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 96c93a7e5bf..67438b0f7e3 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -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; -- 2.30.2