From 40d8ed5ef356866eb6cb4592df789bd2a3b29061 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 6 Mar 2019 10:34:53 -0500 Subject: [PATCH] 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 Reviewed-by: Kristian H. Kristensen --- 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; /* -- 2.30.2