From: Gert Wollny Date: Thu, 15 Nov 2018 18:01:23 +0000 (+0100) Subject: i965: Force zero swizzles for unused components in GL_RED and GL_RG X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5363869d4971780401b21bb75083ef2518c12be;p=mesa.git i965: Force zero swizzles for unused components in GL_RED and GL_RG This makes it possible to use a hardware luminance format as RED format. Signed-off-by: Gert Wollny Reviewed-by: Eric Engestrom --- 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 3286c222e5b..018bae98e88 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -420,7 +420,11 @@ brw_get_texture_swizzle(const struct gl_context *ctx, } break; case GL_RED: + swizzles[1] = SWIZZLE_ZERO; + /* fallthrough */ case GL_RG: + swizzles[2] = SWIZZLE_ZERO; + /* fallthrough */ case GL_RGB: if (_mesa_get_format_bits(img->TexFormat, GL_ALPHA_BITS) > 0 || img->TexFormat == MESA_FORMAT_RGB_DXT1 ||