aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorFritz Koenig <[email protected]>2019-12-04 16:16:43 -0800
committerEric Anholt <[email protected]>2019-12-06 21:27:10 +0000
commitc496d442844183968f7c4903c8ed549aa990d15f (patch)
tree2f0d0f03466bd594e7cfaa5520ebf4129aafc309 /src/gallium/drivers/freedreno
parent21376cffb37018160ad3eef38b5a640ba1675a4f (diff)
freedreno: reorder format check
With the addition of the planar formats helper, the planar formats no longer have a valid block.bits field. Calling util_format_get_blocksize therefore asserts. Reorder the check to see if the format is supported before doing the query to get the blocksize. Fixes: 20f132e5eff2d ("gallium/util: add planar format layouts and helpers") Signed-off-by: Fritz Koenig <[email protected]> Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_screen.c4
-rw-r--r--src/gallium/drivers/freedreno/a5xx/fd5_screen.c4
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_screen.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c
index 98287b95145..db639c72c12 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c
@@ -60,9 +60,9 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen,
}
if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
+ (fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0) &&
(target == PIPE_BUFFER ||
- util_format_get_blocksize(format) != 12) &&
- (fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0)) {
+ util_format_get_blocksize(format) != 12)) {
retval |= PIPE_BIND_SAMPLER_VIEW;
}
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_screen.c b/src/gallium/drivers/freedreno/a5xx/fd5_screen.c
index b478be3aa66..12dcb8a6e80 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_screen.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_screen.c
@@ -76,9 +76,9 @@ fd5_screen_is_format_supported(struct pipe_screen *pscreen,
}
if ((usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE)) &&
+ (fd5_pipe2tex(format) != (enum a5xx_tex_fmt)~0) &&
(target == PIPE_BUFFER ||
- util_format_get_blocksize(format) != 12) &&
- (fd5_pipe2tex(format) != (enum a5xx_tex_fmt)~0)) {
+ util_format_get_blocksize(format) != 12)) {
retval |= usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE);
}
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_screen.c b/src/gallium/drivers/freedreno/a6xx/fd6_screen.c
index d5caf9513ca..6e046cfa8c6 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_screen.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_screen.c
@@ -82,9 +82,9 @@ fd6_screen_is_format_supported(struct pipe_screen *pscreen,
}
if ((usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE)) &&
+ (fd6_pipe2tex(format) != (enum a6xx_tex_fmt)~0) &&
(target == PIPE_BUFFER ||
- util_format_get_blocksize(format) != 12) &&
- (fd6_pipe2tex(format) != (enum a6xx_tex_fmt)~0)) {
+ util_format_get_blocksize(format) != 12)) {
retval |= usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE);
}