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>
This commit is contained in:
Dave Airlie 2023-07-11 15:09:09 +10:00
parent fb925c9260
commit f9c1948a21

View file

@ -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)) {