mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
nir_to_tgsi: Don't vectorize 64-bit instructions, to keep virgl happy.
virglrenderer makes invalid shaders when faced with vector 64-bit instructions, which GLSL-to-TGSI never produced. While this doesn't fix everything, it does get more tests running, and virgl probably the primary consumer of 64-bit TGSI. virgl may be deprecating its host 64-bit support, at which point we can drop this workaround. Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
This commit is contained in:
parent
036d7172c2
commit
eaf6e3d3af
1 changed files with 8 additions and 4 deletions
|
|
@ -2990,14 +2990,18 @@ ntt_should_vectorize_instr(const nir_instr *instr, void *data)
|
|||
break;
|
||||
}
|
||||
|
||||
unsigned num_components = alu->dest.dest.ssa.num_components;
|
||||
|
||||
int src_bit_size = nir_src_bit_size(alu->src[0].src);
|
||||
int dst_bit_size = nir_dest_bit_size(alu->dest.dest);
|
||||
|
||||
if (src_bit_size == 64 || dst_bit_size == 64) {
|
||||
if (num_components > 1)
|
||||
return false;
|
||||
/* 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 false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue