Mesa (master): freedreno/a6xx: fix border-color swizzles

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 7 20:36:01 UTC 2019


Module: Mesa
Branch: master
Commit: 40d8ed5ef356866eb6cb4592df789bd2a3b29061
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=40d8ed5ef356866eb6cb4592df789bd2a3b29061

Author: Rob Clark <robdclark at gmail.com>
Date:   Wed Mar  6 10:34:53 2019 -0500

freedreno/a6xx: fix border-color swizzles

Fixes nearly all of the remaining
dEQP-GLES31.functional.texture.border_clamp.formats.* fails

Signed-off-by: Rob Clark <robdclark at gmail.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg at chromium.org>

---

 src/gallium/drivers/freedreno/a6xx/fd6_emit.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
index 6115fda3b1a..95ac616a76c 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
@@ -196,7 +196,8 @@ setup_border_colors(struct fd_texture_stateobj *tex, struct bcolor_entry *entrie
 		if ((i >= tex->num_textures) || !tex->textures[i])
 			continue;
 
-		enum pipe_format format = tex->textures[i]->format;
+		struct pipe_sampler_view *view = tex->textures[i];
+		enum pipe_format format = view->format;
 		const struct util_format_description *desc =
 				util_format_description(format);
 
@@ -206,8 +207,14 @@ setup_border_colors(struct fd_texture_stateobj *tex, struct bcolor_entry *entrie
 		e->rgb10a2 = 0;
 		e->z24 = 0;
 
+		unsigned char swiz[4];
+
+		fd6_tex_swiz(format, swiz,
+				view->swizzle_r, view->swizzle_g,
+				view->swizzle_b, view->swizzle_a);
+
 		for (j = 0; j < 4; j++) {
-			int c = desc->swizzle[j];
+			int c = swiz[j];
 			int cd = c;
 
 			/*




More information about the mesa-commit mailing list