aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-07-03 15:39:21 -0700
committerEric Anholt <[email protected]>2018-07-05 12:39:36 -0700
commit4b2ba18ff35774eb97a1931cba5bdef0bf4ccba9 (patch)
tree163874653658ec77fe8f0739be91cad2d8491e68 /src/compiler/nir
parent03f6d26b6284cca8f9874928ed11922055247658 (diff)
nir: Apply fragment color clamping to gl_FragData[] as well.
From the ARB_color_buffer_float spec: 35. Should the clamping of fragment shader output gl_FragData[n] be controlled by the fragment color clamp. RESOLVED: Since the destination of the FragData is a color buffer, the fragment color clamp control should apply. Fixes arb_color_buffer_float-mrt mixed on v3d. Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_lower_clamp_color_outputs.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/compiler/nir/nir_lower_clamp_color_outputs.c b/src/compiler/nir/nir_lower_clamp_color_outputs.c
index b76a4d51aac..32f85562427 100644
--- a/src/compiler/nir/nir_lower_clamp_color_outputs.c
+++ b/src/compiler/nir/nir_lower_clamp_color_outputs.c
@@ -47,13 +47,8 @@ is_color_output(lower_state *state, nir_variable *out)
}
break;
case MESA_SHADER_FRAGMENT:
- switch (out->data.location) {
- case FRAG_RESULT_COLOR:
- return true;
- default:
- return false;
- }
- break;
+ return (out->data.location == FRAG_RESULT_COLOR ||
+ out->data.location >= FRAG_RESULT_DATA0);
default:
return false;
}