mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
ir3: Don't reset immediate count to 0 after lowering
We need to know the immediate count even after lowering, to compute the overall const size. Previously we were using the capacity field, but that's unreliable and won't be available once we switch to a real dynamic array container instead of (poorly) reinventing one. Fixes:86f3c0c4c2("ir3: simplify constlen calculation") (cherry picked from commit280c64d720) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41104>
This commit is contained in:
parent
76f4e2078a
commit
c15245f814
4 changed files with 5 additions and 4 deletions
|
|
@ -2284,7 +2284,7 @@
|
|||
"description": "ir3: Don't reset immediate count to 0 after lowering",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "86f3c0c4c2c0044e3b75bcb68079bbf7b5e77243",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -47,6 +47,5 @@ ir3_imm_const_to_preamble(struct ir3 *ir, struct ir3_shader_variant *so)
|
|||
ir3_store_const(so, &build, src, dst);
|
||||
}
|
||||
|
||||
imms->count = 0;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1576,7 +1576,8 @@ tu_xs_get_immediates_packet_size_dwords(const struct ir3_shader_variant *xs)
|
|||
const struct ir3_const_state *const_state = ir3_const_state(xs);
|
||||
uint32_t base = const_state->allocs.max_const_offset_vec4;
|
||||
const struct ir3_imm_const_state *imm_state = &xs->imm_state;
|
||||
int32_t size = DIV_ROUND_UP(imm_state->count, 4);
|
||||
int32_t size = xs->compiler->info->props.load_shader_consts_via_preamble ?
|
||||
0 : DIV_ROUND_UP(imm_state->count, 4);
|
||||
|
||||
/* truncate size to avoid writing constants that shader
|
||||
* does not use:
|
||||
|
|
|
|||
|
|
@ -302,7 +302,8 @@ ir3_emit_immediates(const struct ir3_shader_variant *v,
|
|||
{
|
||||
const struct ir3_const_state *const_state = ir3_const_state(v);
|
||||
uint32_t base = const_state->allocs.max_const_offset_vec4;
|
||||
int size = DIV_ROUND_UP(v->imm_state.count, 4);
|
||||
int size = v->compiler->info->props.load_shader_consts_via_preamble ? 0 :
|
||||
DIV_ROUND_UP(v->imm_state.count, 4);
|
||||
|
||||
/* truncate size to avoid writing constants that shader
|
||||
* does not use:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue