mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
nir/opt_vectorize_io: fix a failure when vectorizing different bit sizes
Fixes: 2514999c9c - nir: add nir_opt_vectorize_io, vectorizing lowered IO
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13085
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34897>
This commit is contained in:
parent
0ffbfa1d54
commit
dbef8f1791
1 changed files with 13 additions and 0 deletions
|
|
@ -76,6 +76,19 @@ compare_is_not_vectorizable(nir_intrinsic_instr *a, nir_intrinsic_instr *b)
|
||||||
sem0.high_16bits != sem1.high_16bits)
|
sem0.high_16bits != sem1.high_16bits)
|
||||||
return sem0.high_16bits > sem1.high_16bits ? 1 : -1;
|
return sem0.high_16bits > sem1.high_16bits ? 1 : -1;
|
||||||
|
|
||||||
|
/* TODO: vectorize (f32, f32, f16vec2, f16vec2) -> vec4
|
||||||
|
* For now, different bit sizes are not vectorized together.
|
||||||
|
*/
|
||||||
|
if (nir_intrinsic_has_src_type(a)) {
|
||||||
|
/* Stores. */
|
||||||
|
if (a->src[0].ssa->bit_size != b->src[0].ssa->bit_size)
|
||||||
|
return a->src[0].ssa->bit_size > b->src[0].ssa->bit_size ? 1 : -1;
|
||||||
|
} else {
|
||||||
|
/* Loads. */
|
||||||
|
if (a->def.bit_size != b->def.bit_size)
|
||||||
|
return a->def.bit_size > b->def.bit_size ? 1 : -1;
|
||||||
|
}
|
||||||
|
|
||||||
nir_shader *shader =
|
nir_shader *shader =
|
||||||
nir_cf_node_get_function(&a->instr.block->cf_node)->function->shader;
|
nir_cf_node_get_function(&a->instr.block->cf_node)->function->shader;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue