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: 20f132e5ef
("gallium/util: add planar format layouts and helpers")
Signed-off-by: Fritz Koenig <frkoenig@google.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
parent
21376cffb3
commit
c496d44284
|
@ -60,9 +60,9 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
|
if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
|
||||||
|
(fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0) &&
|
||||||
(target == PIPE_BUFFER ||
|
(target == PIPE_BUFFER ||
|
||||||
util_format_get_blocksize(format) != 12) &&
|
util_format_get_blocksize(format) != 12)) {
|
||||||
(fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0)) {
|
|
||||||
retval |= PIPE_BIND_SAMPLER_VIEW;
|
retval |= PIPE_BIND_SAMPLER_VIEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,9 +76,9 @@ fd5_screen_is_format_supported(struct pipe_screen *pscreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE)) &&
|
if ((usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE)) &&
|
||||||
|
(fd5_pipe2tex(format) != (enum a5xx_tex_fmt)~0) &&
|
||||||
(target == PIPE_BUFFER ||
|
(target == PIPE_BUFFER ||
|
||||||
util_format_get_blocksize(format) != 12) &&
|
util_format_get_blocksize(format) != 12)) {
|
||||||
(fd5_pipe2tex(format) != (enum a5xx_tex_fmt)~0)) {
|
|
||||||
retval |= usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE);
|
retval |= usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,9 +82,9 @@ fd6_screen_is_format_supported(struct pipe_screen *pscreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE)) &&
|
if ((usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE)) &&
|
||||||
|
(fd6_pipe2tex(format) != (enum a6xx_tex_fmt)~0) &&
|
||||||
(target == PIPE_BUFFER ||
|
(target == PIPE_BUFFER ||
|
||||||
util_format_get_blocksize(format) != 12) &&
|
util_format_get_blocksize(format) != 12)) {
|
||||||
(fd6_pipe2tex(format) != (enum a6xx_tex_fmt)~0)) {
|
|
||||||
retval |= usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE);
|
retval |= usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue