freedreno/ir3: move num_reserved_user_consts out of const_state
authorRob Clark <robdclark@chromium.org>
Tue, 16 Jun 2020 21:09:34 +0000 (14:09 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Jun 2020 13:16:57 +0000 (13:16 +0000)
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>

src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
src/freedreno/ir3/ir3_shader.c
src/freedreno/ir3/ir3_shader.h

index 26f9aadaa5b411275245ab63ce9d430bf0776df4..b41bfe487726c97829146e55af0eed067bacb395 100644 (file)
@@ -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) {
index 82b6c59d5af3b9d1a5555db13fd2e25870551b89..c7d06a99fc2502f1ba98433f0adf913182c881cc 100644 (file)
@@ -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);
index 0123af6763561f7f3c072228d92573ff073034e8..b9dd4a423172dc0f7f4204f3b187859f431d345d 100644 (file)
@@ -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;