diff options
author | Marek Olšák <[email protected]> | 2020-05-24 15:52:26 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-02 20:47:49 +0000 |
commit | cac24bee6202d5bf1c16caa8174494747fa2d56c (patch) | |
tree | abedb8341b942ea27736194aaaf11417a14302da /src/compiler | |
parent | 6503e4be13099f41a4c287ae1983362856a39f44 (diff) |
nir: gather which images are MSAA
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5209>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_gather_info.c | 11 | ||||
-rw-r--r-- | src/compiler/shader_info.h | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index 5a2f8cfc06a..3a65c27b02e 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -598,7 +598,7 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint) shader->info.num_textures = 0; shader->info.num_images = 0; shader->info.image_buffers = 0; - shader->info.last_msaa_image = -1; + shader->info.msaa_images = 0; nir_foreach_variable(var, &shader->uniforms) { /* Bindless textures and images don't use non-bindless slots. @@ -618,13 +618,12 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint) shader->info.image_buffers |= BITFIELD_RANGE(shader->info.num_images, num_image_slots); } + if (glsl_get_sampler_dim(image_type) == GLSL_SAMPLER_DIM_MS) { + shader->info.msaa_images |= + BITFIELD_RANGE(shader->info.num_images, num_image_slots); + } shader->info.num_images += num_image_slots; } - - /* Assuming image slots don't have holes (e.g. OpenGL) */ - if (glsl_type_is_image(var->type) && - glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_MS) - shader->info.last_msaa_image = shader->info.num_images - 1; } shader->info.inputs_read = 0; diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index 6537008af93..57b0eabd79a 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -116,8 +116,6 @@ typedef struct shader_info { uint8_t num_ssbos; /* Number of images used by this shader */ uint8_t num_images; - /* Index of the last MSAA image. */ - int8_t last_msaa_image; /* Which inputs are actually read */ uint64_t inputs_read; @@ -154,6 +152,8 @@ typedef struct shader_info { uint32_t images_used; /** Bitfield of which images are buffers. */ uint32_t image_buffers; + /** Bitfield of which images are MSAA. */ + uint32_t msaa_images; /* SPV_KHR_float_controls: execution mode for floating point ops */ uint16_t float_controls_execution_mode; |