mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 03:18:08 +02:00
nir/validate: Don't spam nir_alu_instr_channels
It doesn't inline and so is about 1% of M1 CTS time. Expand out the definition and simplify the logic. Honestly, I think this is clearer too. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
This commit is contained in:
parent
1786032029
commit
8d5a1e5a77
1 changed files with 7 additions and 4 deletions
|
|
@ -208,12 +208,15 @@ validate_alu_src(nir_alu_instr *instr, unsigned index, validate_state *state)
|
|||
{
|
||||
nir_alu_src *src = &instr->src[index];
|
||||
|
||||
unsigned num_instr_channels = nir_ssa_alu_instr_src_components(instr, index);
|
||||
unsigned num_components = nir_src_num_components(src->src);
|
||||
for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++) {
|
||||
validate_assert(state, src->swizzle[i] < NIR_MAX_VEC_COMPONENTS);
|
||||
|
||||
if (nir_alu_instr_channel_used(instr, index, i))
|
||||
validate_assert(state, src->swizzle[i] < num_components);
|
||||
for (unsigned i = 0; i < num_instr_channels; i++) {
|
||||
validate_assert(state, src->swizzle[i] < num_components);
|
||||
}
|
||||
|
||||
for (unsigned i = num_instr_channels; i < NIR_MAX_VEC_COMPONENTS; i++) {
|
||||
validate_assert(state, src->swizzle[i] < NIR_MAX_VEC_COMPONENTS);
|
||||
}
|
||||
|
||||
validate_src(&src->src, state, 0, 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue