mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-27 04:30:37 +02:00
nir: Don't allow conflicting bitfield lowering passes
Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20323>
This commit is contained in:
parent
8ab7ec0129
commit
db241fbd70
1 changed files with 12 additions and 0 deletions
|
|
@ -1180,6 +1180,18 @@ ${pass_name}(nir_shader *shader)
|
|||
(void) options;
|
||||
(void) info;
|
||||
|
||||
/* This is not a great place for this, but it seems to be the best place
|
||||
* for it. Check that at most one kind of lowering is requested for
|
||||
* bitfield extract and bitfield insert. Otherwise the lowering can fight
|
||||
* with each other and optimizations.
|
||||
*/
|
||||
assert((int)options->lower_bitfield_extract +
|
||||
(int)options->lower_bitfield_extract_to_shifts <= 1);
|
||||
assert((int)options->lower_bitfield_insert +
|
||||
(int)options->lower_bitfield_insert_to_shifts +
|
||||
(int)options->lower_bitfield_insert_to_bitfield_select <= 1);
|
||||
|
||||
|
||||
STATIC_ASSERT(${str(cache["next_index"])} == ARRAY_SIZE(${pass_name}_values));
|
||||
% for index, condition in enumerate(condition_list):
|
||||
condition_flags[${index}] = ${condition};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue