diff options
author | Rob Clark <robdclark@chromium.org> | 2020-06-16 14:09:34 -0700 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-06-19 13:16:57 +0000 |
commit | ab74b792d4b058f428ece7caa9a9020239606b58 (patch) | |
tree | 20a111e7fb38dbf797eed2078b9b6baa5617e0a1 | |
parent | 74140c2e859c15593a379cbde96b1048f2ad69dc (diff) |
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 <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5508>
-rw-r--r-- | src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c | 2 | ||||
-rw-r--r-- | src/freedreno/ir3/ir3_shader.c | 2 | ||||
-rw-r--r-- | 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 26f9aadaa5b..b41bfe48772 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 82b6c59d5af..c7d06a99fc2 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 0123af67635..b9dd4a42317 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; |