aco: Use nir_foreach_variable_with_modes to walk SSBOs
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 21 Jul 2020 16:57:21 +0000 (11:57 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jul 2020 17:38:58 +0000 (17:38 +0000)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

src/amd/compiler/aco_instruction_selection_setup.cpp

index f39f8476b80e5ab13dc402f95755840ef21c3442..aae5967b30f09ca840f3a7a23ee34a2738423c9e 100644 (file)
@@ -327,8 +327,8 @@ void fill_desc_set_info(isel_context *ctx, nir_function_impl *impl)
    }
    ctx->buffer_resource_flags = std::vector<uint8_t>(resource_flag_count);
 
-   nir_foreach_variable(var, &impl->function->shader->uniforms) {
-      if (var->data.mode == nir_var_mem_ssbo && (var->data.access & ACCESS_RESTRICT)) {
+   nir_foreach_variable_with_modes(var, impl->function->shader, nir_var_mem_ssbo) {
+      if (var->data.access & ACCESS_RESTRICT) {
          uint32_t offset = ctx->resource_flag_offsets[var->data.descriptor_set];
          ctx->buffer_resource_flags[offset + var->data.binding] |= buffer_is_restrict;
       }