Mesa (master): freedreno/ir3: move num_reserved_user_consts out of const_state

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 19 13:49:31 UTC 2020


Module: Mesa
Branch: master
Commit: ab74b792d4b058f428ece7caa9a9020239606b58
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab74b792d4b058f428ece7caa9a9020239606b58

Author: Rob Clark <robdclark at chromium.org>
Date:   Tue Jun 16 14:09:34 2020 -0700

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 at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5508>

---

 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 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;



More information about the mesa-commit mailing list