*/
if (shader->CompileStatus == COMPILE_SUCCESS)
return;
-
- if (shader->CompileStatus == COMPILED_NO_OPTS) {
- opt_shader_and_create_symbol_table(ctx,
- NULL, /* source_symbols */
- shader);
- shader->CompileStatus = COMPILE_SUCCESS;
- return;
- }
}
struct _mesa_glsl_parse_state *state =
if (!state->error && !shader->ir->is_empty()) {
assign_subroutine_indexes(state);
lower_subroutine(shader->ir, state);
-
- if (!ctx->Cache || force_recompile)
- opt_shader_and_create_symbol_table(ctx, state->symbols, shader);
- else {
- reparent_ir(shader->ir, shader->ir);
- shader->CompileStatus = COMPILED_NO_OPTS;
- }
+ opt_shader_and_create_symbol_table(ctx, state->symbols, shader);
}
if (!force_recompile) {
/* This is used to flag a shader retrieved from cache */
prog->data->LinkStatus = LINKING_SKIPPED;
- /* Since the program load was successful, CompileStatus of all shaders at
- * this point should normally be compile_skipped. However because of how
- * the eviction works, it may happen that some of the individual shader keys
- * have been evicted, resulting in unnecessary recompiles on this load, so
- * mark them again to skip such recompiles next time.
- */
- char sha1_buf[41];
- for (unsigned i = 0; i < prog->NumShaders; i++) {
- if (prog->Shaders[i]->CompileStatus == COMPILED_NO_OPTS) {
- disk_cache_put_key(cache, prog->Shaders[i]->sha1);
- if (ctx->_Shader->Flags & GLSL_CACHE_INFO) {
- _mesa_sha1_format(sha1_buf, prog->Shaders[i]->sha1);
- fprintf(stderr, "re-marking shader: %s\n", sha1_buf);
- }
- }
- }
-
free (buffer);
return true;