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>
This commit is contained in:
Rob Clark 2020-06-16 14:09:34 -07:00 committed by Marge Bot
parent 74140c2e85
commit ab74b792d4
3 changed files with 3 additions and 3 deletions

View 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) {

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

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