summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2018-11-15 19:01:23 +0100
committerGert Wollny <[email protected]>2018-11-19 08:05:44 +0100
commitc5363869d4971780401b21bb75083ef2518c12be (patch)
tree53569c8efcabe26e87a824ecb61c61d7e2128cb2
parentebcde3454552adc6d3fea8af2207aafaba857796 (diff)
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 <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c4
1 files changed, 4 insertions, 0 deletions
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 ||