gallium/ntt: Don't vectorize IBFE/UBFE/BFI.

Since our source language only allows scalar offset/bits arguments,
virglrenderer only handled scalar values too.  Just refuse to vectorize
these to prevent breakage.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8488>
This commit is contained in:
Eric Anholt
2021-01-13 15:48:36 -08:00
parent 942ee6a547
commit 97d5bc7de3
+16
View File
@@ -2215,6 +2215,22 @@ ntt_should_vectorize_instr(const nir_instr *instr, void *data)
nir_alu_instr *alu = nir_instr_as_alu(instr);
switch (alu->op) {
case nir_op_ibitfield_extract:
case nir_op_ubitfield_extract:
case nir_op_bitfield_insert:
/* virglrenderer only looks at the .x channel of the offset/bits operands
* when translating to GLSL. tgsi.rst doesn't seem to require scalar
* offset/bits operands.
*
* https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/195
*/
return false;
default:
break;
}
unsigned num_components = alu->dest.dest.ssa.num_components;
int src_bit_size = nir_src_bit_size(alu->src[0].src);