nir_to_tgsi: Fix a bug in TXP detection after backend lowering.
TGSI reserves 2 components for the coord in the first operand vector, even
for 1D. Fixes r600 failure with shadow1d.
Fixes: 390a3fcdc4 ("nir_to_tgsi: Add support for TXP.")
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14322>
This commit is contained in:
@@ -2097,7 +2097,7 @@ ntt_emit_texture(struct ntt_compile *c, nir_tex_instr *instr)
|
||||
switch (instr->op) {
|
||||
case nir_texop_tex:
|
||||
if (nir_tex_instr_src_size(instr, nir_tex_instr_src_index(instr, nir_tex_src_backend1)) >
|
||||
instr->coord_components + instr->is_shadow)
|
||||
MAX2(instr->coord_components, 2) + instr->is_shadow)
|
||||
tex_opcode = TGSI_OPCODE_TXP;
|
||||
else
|
||||
tex_opcode = TGSI_OPCODE_TEX;
|
||||
|
||||
Reference in New Issue
Block a user