diff options
author | Marek Olšák <marek.olsak@amd.com> | 2018-05-23 18:46:19 -0400 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2018-07-31 18:28:41 -0400 |
commit | 966f155623e5a626f1d788af7e0f602cdcee6993 (patch) | |
tree | c3ae4f7021a386abcf2c04cba7ca7ac9cca582bc /src/gallium/drivers/nouveau | |
parent | 8632626c81a09315276d7defa63092247d7fd308 (diff) |
gallium: add storage_sample_count parameter into is_format_supported
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Diffstat (limited to 'src/gallium/drivers/nouveau')
4 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c index bddb2e6a385..556bd9bbbbe 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c @@ -415,6 +415,7 @@ nv30_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 bindings) { if (sample_count > nv30_screen(pscreen)->max_sample_count) @@ -423,6 +424,9 @@ nv30_screen_is_format_supported(struct pipe_screen *pscreen, if (!(0x00000017 & (1 << sample_count))) return false; + if (MAX2(1, sample_count) != MAX2(1, storage_sample_count)) + return false; + /* shared is always supported */ bindings &= ~PIPE_BIND_SHARED; diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index 9f8bb46507a..cea6818bc9a 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -46,6 +46,7 @@ nv50_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 bindings) { if (sample_count > 8) @@ -55,6 +56,9 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen, if (sample_count == 8 && util_format_get_blocksizebits(format) >= 128) return false; + if (MAX2(1, sample_count) != MAX2(1, storage_sample_count)) + return false; + switch (format) { case PIPE_FORMAT_Z16_UNORM: if (nv50_screen(pscreen)->tesla->oclass < NVA0_3D_CLASS) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c index 7f32900a6e9..2cbbdc0cc35 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c @@ -185,6 +185,7 @@ nv50_fragprog_validate(struct nv50_context *nv50) fb->cbufs[0]->format, fb->cbufs[0]->texture->target, fb->cbufs[0]->texture->nr_samples, + fb->cbufs[0]->texture->nr_storage_samples, PIPE_BIND_BLENDABLE); /* If we already have alphatest code, we have to keep updating * it. However we only have to have different code if the current RT0 is diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c index a206db38b32..daa4edb0dca 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c @@ -42,6 +42,7 @@ nvc0_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 bindings) { const struct util_format_description *desc = util_format_description(format); @@ -51,6 +52,9 @@ nvc0_screen_is_format_supported(struct pipe_screen *pscreen, if (!(0x117 & (1 << sample_count))) /* 0, 1, 2, 4 or 8 */ return false; + if (MAX2(1, sample_count) != MAX2(1, storage_sample_count)) + return false; + /* Short-circuit the rest of the logic -- this is used by the state tracker * to determine valid MS levels in a no-attachments scenario. */ |