From: Jason Ekstrand Date: Thu, 9 Feb 2017 22:50:01 +0000 (-0800) Subject: i965/surface_state: Use an identity swizzle pre-Haswell X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=23d703de1fb140bb2ed4da247961d89a69f27140;p=mesa.git i965/surface_state: Use an identity swizzle pre-Haswell Reviewed-by: Kenneth Graunke --- 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;