nir: validate that store_buffer_amd doesn't use a non-trivial writemask

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19422>
This commit is contained in:
Marek Olšák
2022-12-07 04:29:59 -05:00
committed by Marge Bot
parent afcbccb078
commit a3aea98a2a

View File

@@ -787,6 +787,17 @@ validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state)
break;
}
case nir_intrinsic_store_buffer_amd:
if (nir_intrinsic_access(instr) & ACCESS_USES_FORMAT_AMD) {
unsigned writemask = nir_intrinsic_write_mask(instr);
/* Make sure the writemask is derived from the component count. */
validate_assert(state,
writemask ==
BITFIELD_MASK(nir_src_num_components(instr->src[0])));
}
break;
default:
break;
}