diff options
author | Marek Olšák <[email protected]> | 2015-09-28 00:04:39 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-10-20 12:51:51 +0200 |
commit | e57dd7a08bfeacab47d64c3adeb392f8c15ca793 (patch) | |
tree | a77c98b79a943272e94518a1e98abce441c9e12d /src/mesa/state_tracker/st_context.c | |
parent | b99645f8190b267231443829aefad1e73c4c25d4 (diff) |
st/mesa: create shaders which have only one variant immediatelly (v2)
v2: fix the condition when lacking sample shading
Reviewed-by: Ilia Mirkin <[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, 14 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 70e006912dc..5abb17385c2 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -294,6 +294,20 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe, ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectSampler = true; } + /* Set which shader types can be compiled at link time. */ + st->shader_has_one_variant[MESA_SHADER_VERTEX] = + st->has_shareable_shaders && + !st->clamp_vert_color_in_shader; + + st->shader_has_one_variant[MESA_SHADER_FRAGMENT] = + st->has_shareable_shaders && + !st->clamp_frag_color_in_shader && + !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; + _mesa_compute_version(ctx); if (ctx->Version == 0) { |