<div dir="ltr"><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 17, 2019 at 1:17 AM Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This basically reverts c2bc0aa7b188.<br>
<br>
By running the opts we reduce memory using in Team Fortress 2<br>
from 1.5GB -> 1.3GB from start-up to game menu.<br>
<br>
This will likely increase Deus Ex start up times as per commit<br>
c2bc0aa7b188. However currently 32bit games like Team Fortress 2<br>
can run out of memory on low memory systems, so that seems more<br>
important.<br>
---<br>
src/compiler/glsl/glsl_parser_extras.cpp | 16 +---------------<br>
src/compiler/glsl/shader_cache.cpp | 17 -----------------<br>
src/mesa/main/mtypes.h | 3 +--<br>
3 files changed, 2 insertions(+), 34 deletions(-)<br>
<br>
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp<br>
index 2048a7f900..200df7759b 100644<br>
--- a/src/compiler/glsl/glsl_parser_extras.cpp<br>
+++ b/src/compiler/glsl/glsl_parser_extras.cpp<br>
@@ -2090,14 +2090,6 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,<br>
*/<br>
if (shader->CompileStatus == COMPILE_SUCCESS)<br>
return;<br>
-<br>
- if (shader->CompileStatus == COMPILED_NO_OPTS) {<br>
- opt_shader_and_create_symbol_table(ctx,<br>
- NULL, /* source_symbols */<br>
- shader);<br>
- shader->CompileStatus = COMPILE_SUCCESS;<br>
- return;<br>
- }<br>
}<br>
<br>
struct _mesa_glsl_parse_state *state =<br>
@@ -2153,13 +2145,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,<br>
if (!state->error && !shader->ir->is_empty()) {<br>
assign_subroutine_indexes(state);<br>
lower_subroutine(shader->ir, state);<br>
-<br>
- if (!ctx->Cache || force_recompile)<br>
- opt_shader_and_create_symbol_table(ctx, state->symbols, shader);<br>
- else {<br>
- reparent_ir(shader->ir, shader->ir);<br>
- shader->CompileStatus = COMPILED_NO_OPTS;<br>
- }<br>
+ opt_shader_and_create_symbol_table(ctx, state->symbols, shader);<br>
}<br>
<br>
if (!force_recompile) {<br>
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp<br>
index 31d0aa6296..879511a9d7 100644<br>
--- a/src/compiler/glsl/shader_cache.cpp<br>
+++ b/src/compiler/glsl/shader_cache.cpp<br>
@@ -264,23 +264,6 @@ shader_cache_read_program_metadata(struct gl_context *ctx,<br>
/* This is used to flag a shader retrieved from cache */<br>
prog->data->LinkStatus = LINKING_SKIPPED;<br>
<br>
- /* Since the program load was successful, CompileStatus of all shaders at<br>
- * this point should normally be compile_skipped. However because of how<br>
- * the eviction works, it may happen that some of the individual shader keys<br>
- * have been evicted, resulting in unnecessary recompiles on this load, so<br>
- * mark them again to skip such recompiles next time.<br>
- */<br>
- char sha1_buf[41];<br>
- for (unsigned i = 0; i < prog->NumShaders; i++) {<br>
- if (prog->Shaders[i]->CompileStatus == COMPILED_NO_OPTS) {<br>
- disk_cache_put_key(cache, prog->Shaders[i]->sha1);<br>
- if (ctx->_Shader->Flags & GLSL_CACHE_INFO) {<br>
- _mesa_sha1_format(sha1_buf, prog->Shaders[i]->sha1);<br>
- fprintf(stderr, "re-marking shader: %s\n", sha1_buf);<br>
- }<br>
- }<br>
- }<br>
-<br>
free (buffer);<br>
<br>
return true;<br>
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h<br>
index 241c2b92f7..0fdeba4732 100644<br>
--- a/src/mesa/main/mtypes.h<br>
+++ b/src/mesa/main/mtypes.h<br>
@@ -2576,8 +2576,7 @@ enum gl_compile_status<br>
{<br>
COMPILE_FAILURE = 0,<br>
COMPILE_SUCCESS,<br>
- COMPILE_SKIPPED,<br>
- COMPILED_NO_OPTS<br>
+ COMPILE_SKIPPED<br>
};<br>
<br>
/**<br>
-- <br>
2.20.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>