mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-03 19:30:26 +01:00
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>
Cc: 21.2 mesa-stable
(cherry picked from commit 6751d832c5)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12200>
This commit is contained in:
parent
3fd0ced541
commit
a7f1ebda2c
1 changed files with 5 additions and 2 deletions
|
|
@ -68,8 +68,11 @@ draw_create_vertex_shader(struct draw_context *draw,
|
|||
if (draw->pt.middle.llvm) {
|
||||
struct pipe_screen *screen = draw->pipe->screen;
|
||||
if (shader->type == PIPE_SHADER_IR_NIR &&
|
||||
(!screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
|
||||
PIPE_SHADER_CAP_INTEGERS))) {
|
||||
((!screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
|
||||
PIPE_SHADER_CAP_INTEGERS)) ||
|
||||
(screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
|
||||
PIPE_SHADER_CAP_PREFERRED_IR) ==
|
||||
PIPE_SHADER_IR_TGSI))) {
|
||||
state.type = PIPE_SHADER_IR_TGSI;
|
||||
state.tokens = nir_to_tgsi(shader->ir.nir, screen);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue