summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2018-04-20 14:34:45 +0200
committerJuan A. Suarez Romero <jasuarez@igalia.com>2018-04-23 12:18:53 +0200
commit7673c72f3d9439a7d22a89c2d00051d5f6a29fc9 (patch)
tree01acab307afcdac6d8db79756d21aa4ec5d0784c
parent264cda58ab55c72e3ed85537687aff950250d842 (diff)
etnaviv: fix texture_format_needs_swiz
memcmp returns 0 when both swizzles are the same, which means we don't need any hardware swizzling. texture_format_needs_swiz should return true when the return value of the memcmp is non-zero. Fixes: 751ae6afbefd ("etnaviv: add support for swizzled texture formats") Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Marek Vasut <marex@denx.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com> (cherry picked from commit 52e93e309f34972dfd5b84075c13ae8d6b9f63df)
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_format.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_format.c b/src/gallium/drivers/etnaviv/etnaviv_format.c
index 7943c819d5..29e81c4a8b 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_format.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_format.c
@@ -302,7 +302,7 @@ texture_format_needs_swiz(enum pipe_format fmt)
bool swiz = false;
if (formats[fmt].present)
- swiz = !memcmp(def, formats[fmt].tex_swiz, sizeof(formats[fmt].tex_swiz));
+ swiz = !!memcmp(def, formats[fmt].tex_swiz, sizeof(formats[fmt].tex_swiz));
return swiz;
}