From ab74b792d4b058f428ece7caa9a9020239606b58 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 16 Jun 2020 14:09:34 -0700 Subject: [PATCH] freedreno/ir3: move num_reserved_user_consts out of const_state When we move const_state to the variant, this will need to stay in the shader, as it applies to all variants (and we need to store it somewhere before we have any variants) Signed-off-by: Rob Clark Part-of: --- src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c | 2 +- src/freedreno/ir3/ir3_shader.c | 2 +- src/freedreno/ir3/ir3_shader.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c index 26f9aad..b41bfe4 100644 --- a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c +++ b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c @@ -343,7 +343,7 @@ ir3_nir_analyze_ubo_ranges(nir_shader *nir, struct ir3_shader *shader) const uint32_t max_upload = (shader->compiler->max_const - worst_case_const_state.offsets.immediate) * 16; - uint32_t offset = shader->const_state.num_reserved_user_consts * 16; + uint32_t offset = shader->num_reserved_user_consts * 16; state->num_enabled = ARRAY_SIZE(state->range); for (uint32_t i = 0; i < ARRAY_SIZE(state->range); i++) { if (state->range[i].start >= state->range[i].end) { diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c index 82b6c59..c7d06a9 100644 --- a/src/freedreno/ir3/ir3_shader.c +++ b/src/freedreno/ir3/ir3_shader.c @@ -345,7 +345,7 @@ ir3_shader_from_nir(struct ir3_compiler *compiler, nir_shader *nir, shader->type = nir->info.stage; if (stream_output) memcpy(&shader->stream_output, stream_output, sizeof(shader->stream_output)); - shader->const_state.num_reserved_user_consts = reserved_user_consts; + shader->num_reserved_user_consts = reserved_user_consts; if (nir->info.stage == MESA_SHADER_GEOMETRY) NIR_PASS_V(nir, ir3_nir_lower_gs); diff --git a/src/freedreno/ir3/ir3_shader.h b/src/freedreno/ir3/ir3_shader.h index 0123af6..b9dd4a4 100644 --- a/src/freedreno/ir3/ir3_shader.h +++ b/src/freedreno/ir3/ir3_shader.h @@ -130,7 +130,6 @@ struct ir3_ubo_analysis_state { */ struct ir3_const_state { unsigned num_ubos; - unsigned num_reserved_user_consts; unsigned num_driver_params; /* scalar */ struct { @@ -623,6 +622,7 @@ struct ir3_shader { struct ir3_compiler *compiler; struct ir3_const_state const_state; + unsigned num_reserved_user_consts; struct nir_shader *nir; struct ir3_stream_output_info stream_output; -- 2.7.4