summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2014-05-18 15:19:34 -0400
committerRob Clark <robclark@freedesktop.org>2014-05-20 08:48:20 -0400
commitfec2b45d026310bab4a470fa7f88acf1f8c9a9e2 (patch)
treef847fc2e44c554796dec281e488b662eee22876c /src
parentd0c813c40ae4e0bb3b39eb6ab8ce078c4a8ef2de (diff)
freedreno/a3xx: use util_format_compose_swizzles()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_util.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_util.c b/src/gallium/drivers/freedreno/a3xx/fd3_util.c
index 2cc8b8b5ced..682b47d0836 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_util.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_util.c
@@ -389,14 +389,14 @@ fd3_tex_swiz(enum pipe_format format, unsigned swizzle_r, unsigned swizzle_g,
{
const struct util_format_description *desc =
util_format_description(format);
- uint8_t swiz[] = {
+ unsigned char swiz[4] = {
swizzle_r, swizzle_g, swizzle_b, swizzle_a,
- PIPE_SWIZZLE_ZERO, PIPE_SWIZZLE_ONE,
- PIPE_SWIZZLE_ONE, PIPE_SWIZZLE_ONE,
- };
-
- return A3XX_TEX_CONST_0_SWIZ_X(tex_swiz(swiz[desc->swizzle[0]])) |
- A3XX_TEX_CONST_0_SWIZ_Y(tex_swiz(swiz[desc->swizzle[1]])) |
- A3XX_TEX_CONST_0_SWIZ_Z(tex_swiz(swiz[desc->swizzle[2]])) |
- A3XX_TEX_CONST_0_SWIZ_W(tex_swiz(swiz[desc->swizzle[3]]));
+ }, rswiz[4];
+
+ util_format_compose_swizzles(desc->swizzle, swiz, rswiz);
+
+ return A3XX_TEX_CONST_0_SWIZ_X(tex_swiz(rswiz[0])) |
+ A3XX_TEX_CONST_0_SWIZ_Y(tex_swiz(rswiz[1])) |
+ A3XX_TEX_CONST_0_SWIZ_Z(tex_swiz(rswiz[2])) |
+ A3XX_TEX_CONST_0_SWIZ_W(tex_swiz(rswiz[3]));
}