diff options
author | Marek Olšák <[email protected]> | 2018-05-23 18:46:19 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-07-31 18:28:41 -0400 |
commit | 966f155623e5a626f1d788af7e0f602cdcee6993 (patch) | |
tree | c3ae4f7021a386abcf2c04cba7ca7ac9cca582bc /src/gallium/drivers/freedreno | |
parent | 8632626c81a09315276d7defa63092247d7fd308 (diff) |
gallium: add storage_sample_count parameter into is_format_supported
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
5 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_screen.c b/src/gallium/drivers/freedreno/a2xx/fd2_screen.c index 4fdf6914ab2..2f701ddaa2f 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_screen.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_screen.c @@ -38,6 +38,7 @@ fd2_screen_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format, enum pipe_texture_target target, unsigned sample_count, + unsigned storage_sample_count, unsigned usage) { unsigned retval = 0; @@ -49,6 +50,9 @@ fd2_screen_is_format_supported(struct pipe_screen *pscreen, return FALSE; } + if (MAX2(1, sample_count) != MAX2(1, storage_sample_count)) + return false; + /* TODO figure out how to render to other formats.. */ if ((usage & PIPE_BIND_RENDER_TARGET) && ((format != PIPE_FORMAT_B5G6R5_UNORM) && diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_screen.c b/src/gallium/drivers/freedreno/a3xx/fd3_screen.c index 366f07ef34b..a1c46684d4b 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_screen.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_screen.c @@ -39,6 +39,7 @@ fd3_screen_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format, enum pipe_texture_target target, unsigned sample_count, + unsigned storage_sample_count, unsigned usage) { unsigned retval = 0; @@ -50,6 +51,9 @@ fd3_screen_is_format_supported(struct pipe_screen *pscreen, return FALSE; } + if (MAX2(1, sample_count) != MAX2(1, storage_sample_count)) + return false; + if ((usage & PIPE_BIND_VERTEX_BUFFER) && (fd3_pipe2vtx(format) != (enum a3xx_vtx_fmt)~0)) { retval |= PIPE_BIND_VERTEX_BUFFER; diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c index 30124e4485d..bfec76cab62 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c @@ -39,6 +39,7 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format, enum pipe_texture_target target, unsigned sample_count, + unsigned storage_sample_count, unsigned usage) { unsigned retval = 0; @@ -50,6 +51,9 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen, return FALSE; } + if (MAX2(1, sample_count) != MAX2(1, storage_sample_count)) + return false; + if ((usage & PIPE_BIND_VERTEX_BUFFER) && (fd4_pipe2vtx(format) != (enum a4xx_vtx_fmt)~0)) { retval |= PIPE_BIND_VERTEX_BUFFER; diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_screen.c b/src/gallium/drivers/freedreno/a5xx/fd5_screen.c index 37095be7536..7d8d2b3e5b8 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_screen.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_screen.c @@ -54,6 +54,7 @@ fd5_screen_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format, enum pipe_texture_target target, unsigned sample_count, + unsigned storage_sample_count, unsigned usage) { unsigned retval = 0; @@ -65,6 +66,9 @@ fd5_screen_is_format_supported(struct pipe_screen *pscreen, return FALSE; } + if (MAX2(1, sample_count) != MAX2(1, storage_sample_count)) + return false; + if ((usage & PIPE_BIND_VERTEX_BUFFER) && (fd5_pipe2vtx(format) != (enum a5xx_vtx_fmt)~0)) { retval |= PIPE_BIND_VERTEX_BUFFER; diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 8147ff57a99..3fbf50003e9 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -148,6 +148,7 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc, */ if (!pctx->screen->is_format_supported(pctx->screen, prsc->format, prsc->target, prsc->nr_samples, + prsc->nr_storage_samples, PIPE_BIND_RENDER_TARGET)) fallback = true; |