diff options
author | Rob Clark <[email protected]> | 2016-04-25 09:07:04 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-04-30 14:56:19 -0400 |
commit | e04db879f8933915501bfb9cce0d1359d62766bd (patch) | |
tree | 765b56d0a273fefaa0a922e037842e1c445a15fd /src/gallium/drivers/freedreno/ir3 | |
parent | 64abf6d404be9030d1232e1533a64edb09ad8b13 (diff) |
freedreno/ir3: handle color clamp variant ourselves
Now that there is a pass to do this in NIR, lets just use that and
manage the variants ourself, rather than letting state-tracker do it.
This way, mesa/st will precompile shaders without requiring
ST_DEBUG=precompile (which requires a debug build).
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_nir.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_shader.h | 2 |
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; }; |