From f9c1948a21dbb91594cd9a04ffe74f2d4babeebb Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 11 Jul 2023 15:09:09 +1000 Subject: [PATCH] llvmpipe/linear: don't allow linear path for shader output with location frac This has been broken for a while, but we weren't hitting the linear paths in CI This fixes: tests/spec/arb_enhanced_layouts/execution/component-layout/fs-output.shader_test. Reviewed-by: Mike Blumenkrantz Cc: mesa-stable Part-of: --- src/gallium/drivers/llvmpipe/lp_state_fs_analysis.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs_analysis.c b/src/gallium/drivers/llvmpipe/lp_state_fs_analysis.c index eac6c89..574a287 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs_analysis.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs_analysis.c @@ -367,8 +367,15 @@ llvmpipe_nir_fn_is_linear_compat(const struct nir_shader *shader, nir_foreach_block(block, impl) { nir_foreach_instr_safe(instr, block) { switch (instr->type) { - case nir_instr_type_deref: + case nir_instr_type_deref: { + nir_deref_instr *deref = nir_instr_as_deref(instr); + if (deref->deref_type != nir_deref_type_var) + return false; + if (deref->var->data.mode == nir_var_shader_out && + deref->var->data.location_frac != 0) + return false; break; + } case nir_instr_type_load_const: { nir_load_const_instr *load = nir_instr_as_load_const(instr); if (!check_load_const_in_zero_one(load)) { -- 2.7.4