aux/draw: Check for preferred IR to take nir-to-tgsi path in draw module
authorCharmaine Lee <charmainel@vmware.com>
Fri, 30 Jul 2021 23:53:53 +0000 (16:53 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 3 Aug 2021 22:13:10 +0000 (22:13 +0000)
commit6751d832c5a3fd437216361a1a55f1fa1d0aed9b
tree1327117c4b9b4d110284e764c7e4c02a6ab1b279
parent0ddac113f87ff12c6d251a2cc39e39a3ae784583
aux/draw: Check for preferred IR to take nir-to-tgsi path in draw module

When a vertex program is translated to nir, it uses
nir_to_tgsi_compile_options for drivers with only nir-to-tgsi based
NIR support. But this compile option might not be the same as the NIR
compile option from llvmpipe, hence when the nir shader is bound
to the draw module, it hits an assertion in do_alu_action() when
encounters nir_op_fdot3.

With this patch, draw will take the nir-to-tgsi path if preferred IR
from the driver is TGSI.

Fixes assert running Maya on SVGA device.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12176>
src/gallium/auxiliary/draw/draw_vs.c