diff options
author | Shawn Guo <[email protected]> | 2020-06-30 20:40:53 +0800 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-30 14:23:29 +0000 |
commit | b1d309eaa39a695da5adc7dfd663cb2a4179710e (patch) | |
tree | 29594bb508a9793ddfa49da3d40e188aa7534019 | |
parent | fa673920483d81a7a3ed110cfaa4d8f21d3d00c4 (diff) |
freedreno/a4xx: fix *_NONE enum conversion
Commit e369b8931c67 ("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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5693>
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_format.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_screen.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_format.c b/src/gallium/drivers/freedreno/a4xx/fd4_format.c index c41015857d6..3e7fff51743 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_format.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_format.c @@ -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; } diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c index 8f60b51bf8f..ee6403f9c5d 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c @@ -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; } |