diff options
author | Timothy Arceri <[email protected]> | 2019-06-25 20:53:15 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2019-06-26 00:36:48 +0000 |
commit | d19fe5e67a3945582448748c72b10fd5029d2ed5 (patch) | |
tree | de982ef463558b0423501dbe9fc9d904b917e0f9 /src/mesa/state_tracker/st_context.c | |
parent | f5f31612d3392cb9ea015b157c4d564ac549a2f5 (diff) |
st/glsl: support clamping color outputs in compat for gs/tes
This support requires the driver to be a NIR driver as we use the
NIR lowering pass to do the clamping.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 875be9d0029..e60962388cb 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -238,8 +238,12 @@ st_invalidate_state(struct gl_context *ctx) st->dirty |= ST_NEW_VERTEX_ARRAYS; /* Update the vertex shader if ctx->Light._ClampVertexColor was changed. */ - if (st->clamp_vert_color_in_shader && (new_state & _NEW_LIGHT)) + if (st->clamp_vert_color_in_shader && (new_state & _NEW_LIGHT)) { st->dirty |= ST_NEW_VS_STATE; + if (st->ctx->API == API_OPENGL_COMPAT && ctx->Version >= 32) { + st->dirty |= ST_NEW_GS_STATE | ST_NEW_TES_STATE; + } + } /* Which shaders are dirty will be determined manually. */ if (new_state & _NEW_PROGRAM) { @@ -701,8 +705,12 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, !st->force_persample_in_shader; st->shader_has_one_variant[MESA_SHADER_TESS_CTRL] = st->has_shareable_shaders; - st->shader_has_one_variant[MESA_SHADER_TESS_EVAL] = st->has_shareable_shaders; - st->shader_has_one_variant[MESA_SHADER_GEOMETRY] = st->has_shareable_shaders; + st->shader_has_one_variant[MESA_SHADER_TESS_EVAL] = + st->has_shareable_shaders && + !st->clamp_vert_color_in_shader; + st->shader_has_one_variant[MESA_SHADER_GEOMETRY] = + st->has_shareable_shaders && + !st->clamp_vert_color_in_shader; st->shader_has_one_variant[MESA_SHADER_COMPUTE] = st->has_shareable_shaders; st->bitmap.cache.empty = true; |