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 <michael.blumenkrantz@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24083>
(cherry picked from commit f9c1948a21)
This commit is contained in:
Dave Airlie 2023-07-11 15:09:09 +10:00 committed by Eric Engestrom
parent 7880ada0df
commit 59a2836117
2 changed files with 9 additions and 2 deletions

View file

@ -1624,7 +1624,7 @@
"description": "llvmpipe/linear: don't allow linear path for shader output with location frac",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -369,8 +369,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)) {