From 868eee6e1812d414566b59598387af3b027edbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Thu, 1 Jun 2023 07:12:49 +0200 Subject: [PATCH] r300: simplify vectorization rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Ondračka Reviewed-by: Emma Anholt Reviewed-by: Filip Gawin Part-of: --- src/gallium/drivers/r300/compiler/nir_to_rc.c | 35 +------------------ 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/src/gallium/drivers/r300/compiler/nir_to_rc.c b/src/gallium/drivers/r300/compiler/nir_to_rc.c index d9766630662..7f4eed501ea 100644 --- a/src/gallium/drivers/r300/compiler/nir_to_rc.c +++ b/src/gallium/drivers/r300/compiler/nir_to_rc.c @@ -2449,8 +2449,7 @@ type_size(const struct glsl_type *type, bool bindless) return glsl_count_attribute_slots(type, false); } -/* Allow vectorizing of ALU instructions, but avoid vectorizing past what we - * can handle for 64-bit values in TGSI. +/* Allow vectorizing of ALU instructions. */ static uint8_t ntr_should_vectorize_instr(const nir_instr *instr, const void *data) @@ -2458,38 +2457,6 @@ ntr_should_vectorize_instr(const nir_instr *instr, const void *data) if (instr->type != nir_instr_type_alu) return 0; - 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 1; - - default: - break; - } - - int src_bit_size = nir_src_bit_size(alu->src[0].src); - int dst_bit_size = alu->def.bit_size; - - if (src_bit_size == 64 || dst_bit_size == 64) { - /* Avoid vectorizing 64-bit instructions at all. Despite tgsi.rst - * claiming support, virglrenderer generates bad shaders on the host when - * presented with them. Maybe we can make virgl avoid tickling the - * virglrenderer bugs, but given that glsl-to-TGSI didn't generate vector - * 64-bit instrs in the first place, I don't see much reason to care about - * this. - */ - return 1; - } - return 4; }