diff options
author | Eric Anholt <[email protected]> | 2016-05-17 12:57:44 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-05-17 18:09:58 -0700 |
commit | 18260d05820eca971873407e939007c12600660c (patch) | |
tree | 3e61d435ab6b06ff00743f10d5f89fb30e5cfee7 /src/gallium/drivers/vc4/vc4_program.c | |
parent | 474e2bbcc12b1f7d959c55a1d730ad54ecef98f4 (diff) |
vc4: Add support for vertex color clamping in the rasterizer.
This gets us precompile of vertex shaders at the state tracker level as
well.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 90c4b2d9014..5d036eb2604 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -1840,6 +1840,9 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage, if (c->fs_key && c->fs_key->light_twoside) NIR_PASS_V(c->s, nir_lower_two_sided_color); + if (c->vs_key && c->vs_key->clamp_color) + NIR_PASS_V(c->s, nir_lower_clamp_color_outputs); + if (stage == QSTAGE_FRAG) NIR_PASS_V(c->s, nir_lower_clip_fs, c->key->ucp_enables); else @@ -2214,6 +2217,7 @@ vc4_update_compiled_vs(struct vc4_context *vc4, uint8_t prim_mode) vc4_setup_shared_key(vc4, &key->base, &vc4->verttex); key->base.shader_state = vc4->prog.bind_vs; key->compiled_fs_id = vc4->prog.fs->program_id; + key->clamp_color = vc4->rasterizer->base.clamp_vertex_color; for (int i = 0; i < ARRAY_SIZE(key->attr_formats); i++) key->attr_formats[i] = vc4->vtx->pipe[i].src_format; |