Mesa (10.4): i965: Override swizzles for integer luminance formats.
Emil Velikov
evelikov at kemper.freedesktop.org
Wed Feb 18 22:22:17 UTC 2015
Module: Mesa
Branch: 10.4
Commit: 2ad93851ff3f3bd44867fad6e28798a367417cb1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2ad93851ff3f3bd44867fad6e28798a367417cb1
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Fri Feb 6 02:06:27 2015 -0800
i965: Override swizzles for integer luminance formats.
The hardware's integer luminance formats are completely unusable;
currently we fall back to RGBA. This means we need to override
the texture swizzle to obtain the XXX1 values expected for luminance
formats.
Fixes spec/EXT_texture_integer/texwrap formats bordercolor [swizzled]
on Broadwell - 100% of border color tests now pass on Broadwell.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>
Cc: mesa-stable at lists.freedesktop.org
(cherry picked from commit 8cb18760cccf2c89d94c50ff14b330ec2d5c4a3c)
---
src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 8 ++++++++
1 file changed, 8 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 b38eba1..cb0e13d 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -199,6 +199,14 @@ brw_get_texture_swizzle(const struct gl_context *ctx,
swizzles[1] = SWIZZLE_ZERO;
swizzles[2] = SWIZZLE_ZERO;
break;
+ case GL_LUMINANCE:
+ if (t->_IsIntegerFormat) {
+ swizzles[0] = SWIZZLE_X;
+ swizzles[1] = SWIZZLE_X;
+ swizzles[2] = SWIZZLE_X;
+ swizzles[3] = SWIZZLE_ONE;
+ }
+ break;
case GL_RED:
case GL_RG:
case GL_RGB:
More information about the mesa-commit
mailing list