mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
freedreno/a4xx: fix *_NONE enum conversion
Commit e369b8931c ("freedreno: Use explicit *_NONE enum for undefined
formats") only partially converts ~0 to *_NONE enum. It breaks texture
support, and glmark2 texture scene gives a black screen.
Adding the missing conversion of ~0 to *_NONE enum fixes the issue.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5693>
This commit is contained in:
parent
fa67392048
commit
b1d309eaa3
2 changed files with 8 additions and 8 deletions
|
|
@ -339,7 +339,7 @@ enum a4xx_vtx_fmt
|
|||
fd4_pipe2vtx(enum pipe_format format)
|
||||
{
|
||||
if (!formats[format].present)
|
||||
return ~0;
|
||||
return VFMT4_NONE;
|
||||
return formats[format].vtx;
|
||||
}
|
||||
|
||||
|
|
@ -348,7 +348,7 @@ enum a4xx_tex_fmt
|
|||
fd4_pipe2tex(enum pipe_format format)
|
||||
{
|
||||
if (!formats[format].present)
|
||||
return ~0;
|
||||
return TFMT4_NONE;
|
||||
return formats[format].tex;
|
||||
}
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ enum a4xx_color_fmt
|
|||
fd4_pipe2color(enum pipe_format format)
|
||||
{
|
||||
if (!formats[format].present)
|
||||
return ~0;
|
||||
return RB4_NONE;
|
||||
return formats[format].rb;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen,
|
|||
return false;
|
||||
|
||||
if ((usage & PIPE_BIND_VERTEX_BUFFER) &&
|
||||
(fd4_pipe2vtx(format) != (enum a4xx_vtx_fmt)~0)) {
|
||||
(fd4_pipe2vtx(format) != VFMT4_NONE)) {
|
||||
retval |= PIPE_BIND_VERTEX_BUFFER;
|
||||
}
|
||||
|
||||
if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
|
||||
(fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0) &&
|
||||
(fd4_pipe2tex(format) != TFMT4_NONE) &&
|
||||
(target == PIPE_BUFFER ||
|
||||
util_format_get_blocksize(format) != 12)) {
|
||||
retval |= PIPE_BIND_SAMPLER_VIEW;
|
||||
|
|
@ -71,8 +71,8 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen,
|
|||
PIPE_BIND_DISPLAY_TARGET |
|
||||
PIPE_BIND_SCANOUT |
|
||||
PIPE_BIND_SHARED)) &&
|
||||
(fd4_pipe2color(format) != (enum a4xx_color_fmt)~0) &&
|
||||
(fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0)) {
|
||||
(fd4_pipe2color(format) != RB4_NONE) &&
|
||||
(fd4_pipe2tex(format) != TFMT4_NONE)) {
|
||||
retval |= usage & (PIPE_BIND_RENDER_TARGET |
|
||||
PIPE_BIND_DISPLAY_TARGET |
|
||||
PIPE_BIND_SCANOUT |
|
||||
|
|
@ -86,7 +86,7 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen,
|
|||
|
||||
if ((usage & PIPE_BIND_DEPTH_STENCIL) &&
|
||||
(fd4_pipe2depth(format) != (enum a4xx_depth_format)~0) &&
|
||||
(fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0)) {
|
||||
(fd4_pipe2tex(format) != TFMT4_NONE)) {
|
||||
retval |= PIPE_BIND_DEPTH_STENCIL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue