summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_nir.c7
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_shader.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
index 364e92beb53..99c2ecba480 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
@@ -58,7 +58,8 @@ ir3_key_lowers_nir(const struct ir3_shader_key *key)
{
return key->fsaturate_s | key->fsaturate_t | key->fsaturate_r |
key->vsaturate_s | key->vsaturate_t | key->vsaturate_r |
- key->ucp_enables | key->color_two_side;
+ key->ucp_enables | key->color_two_side |
+ key->fclamp_color | key->vclamp_color;
}
#define OPT(nir, pass, ...) ({ \
@@ -114,8 +115,12 @@ ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s,
if (key) {
if (s->stage == MESA_SHADER_VERTEX) {
OPT_V(s, nir_lower_clip_vs, key->ucp_enables);
+ if (key->vclamp_color)
+ OPT_V(s, nir_lower_clamp_color_outputs);
} else if (s->stage == MESA_SHADER_FRAGMENT) {
OPT_V(s, nir_lower_clip_fs, key->ucp_enables);
+ if (key->fclamp_color)
+ OPT_V(s, nir_lower_clamp_color_outputs);
}
if (key->color_two_side) {
OPT_V(s, nir_lower_two_sided_color);
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.h b/src/gallium/drivers/freedreno/ir3/ir3_shader.h
index e81e80d328f..ff6bf1d67b8 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_shader.h
+++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.h
@@ -81,6 +81,7 @@ struct ir3_shader_key {
* Vertex shader variant parameters:
*/
unsigned binning_pass : 1;
+ unsigned vclamp_color : 1;
/*
* Fragment shader variant parameters:
@@ -91,6 +92,7 @@ struct ir3_shader_key {
* for front/back color inputs to frag shader:
*/
unsigned rasterflat : 1;
+ unsigned fclamp_color : 1;
};
uint32_t global;
};