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/svga | |
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/svga')
-rw-r--r-- | src/gallium/drivers/svga/svga_format.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_format.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_pipe_clear.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_resource_texture.c | 3 |
4 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_format.c b/src/gallium/drivers/svga/svga_format.c index c9adee11afb..0b202600c20 100644 --- a/src/gallium/drivers/svga/svga_format.c +++ b/src/gallium/drivers/svga/svga_format.c @@ -2082,6 +2082,7 @@ svga_is_format_supported(struct pipe_screen *screen, enum pipe_format format, enum pipe_texture_target target, unsigned sample_count, + unsigned storage_sample_count, unsigned bindings) { struct svga_screen *ss = svga_screen(screen); @@ -2091,6 +2092,9 @@ svga_is_format_supported(struct pipe_screen *screen, assert(bindings); + if (MAX2(1, sample_count) != MAX2(1, storage_sample_count)) + return false; + if (sample_count > 1) { /* In ms_samples, if bit N is set it means that we support * multisample with N+1 samples per pixel. diff --git a/src/gallium/drivers/svga/svga_format.h b/src/gallium/drivers/svga/svga_format.h index c063589cafe..11e7e41e506 100644 --- a/src/gallium/drivers/svga/svga_format.h +++ b/src/gallium/drivers/svga/svga_format.h @@ -127,6 +127,7 @@ svga_is_format_supported(struct pipe_screen *screen, enum pipe_format format, enum pipe_texture_target target, unsigned sample_count, + unsigned storage_sample_count, unsigned bindings); diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index e234ef58715..d1287178c56 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -422,6 +422,7 @@ svga_clear_texture(struct pipe_context *pipe, pipe->screen->is_format_supported(pipe->screen, rtv->format, rtv->texture->target, rtv->texture->nr_samples, + rtv->texture->nr_storage_samples, PIPE_BIND_RENDER_TARGET)) { /* clear with quad drawing */ util_blitter_save_framebuffer(svga->blitter, diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c index 71b8ebe7d42..068862bb780 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.c +++ b/src/gallium/drivers/svga/svga_resource_texture.c @@ -1040,6 +1040,7 @@ svga_texture_create(struct pipe_screen *screen, if (screen->is_format_supported(screen, template->format, template->target, template->nr_samples, + template->nr_storage_samples, PIPE_BIND_SAMPLER_VIEW)) { bindings |= PIPE_BIND_SAMPLER_VIEW; } @@ -1054,6 +1055,7 @@ svga_texture_create(struct pipe_screen *screen, if (screen->is_format_supported(screen, template->format, template->target, template->nr_samples, + template->nr_storage_samples, PIPE_BIND_RENDER_TARGET)) { bindings |= PIPE_BIND_RENDER_TARGET; } @@ -1064,6 +1066,7 @@ svga_texture_create(struct pipe_screen *screen, if (screen->is_format_supported(screen, template->format, template->target, template->nr_samples, + template->nr_storage_samples, PIPE_BIND_DEPTH_STENCIL)) { bindings |= PIPE_BIND_DEPTH_STENCIL; } |