summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-11-08 09:54:22 +1100
committerTimothy Arceri <[email protected]>2017-11-09 12:07:48 +1100
commitcf05bb506a075c9e3b8a3c374b928ff0367c49b2 (patch)
tree2a08cd32fdc212b488894b45936eb6a9ed06453a /src/mesa
parenta16dc04ad51c32e5c7d136e4dd6273d983385d3f (diff)
glsl: drop cache_fallback
This turned out to be a dead end, it is much easier and less error prone to just cache the IR used by the drivers backend e.g. TGSI or NIR. Cc: "17.2 17.3" <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/mtypes.h7
-rw-r--r--src/mesa/main/shaderobj.c23
2 files changed, 13 insertions, 17 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 2acf64eb56d..a6931649aa0 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2872,12 +2872,11 @@ struct gl_shader_program_data
unsigned NumUniformDataSlots;
union gl_constant_value *UniformDataSlots;
- bool cache_fallback;
-
/* TODO: This used by Gallium drivers to skip the cache on tgsi fallback.
* All structures (gl_program, uniform storage, etc) will get recreated
- * even though we have already loaded them from cache. Once the i965 cache
- * lands we should switch to using the cache_fallback support.
+ * even though we have already loaded them from cache. We should instead
+ * switch to storing the GLSL metadata and TGSI IR in a single cache item
+ * like the i965 driver does with NIR.
*/
bool skip_cache;
GLboolean Validated;
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index b9d1079a35a..e2103bcde49 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -327,7 +327,7 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
shProg->data->linked_stages = 0;
- if (shProg->data->UniformStorage && !shProg->data->cache_fallback) {
+ if (shProg->data->UniformStorage) {
for (unsigned i = 0; i < shProg->data->NumUniformStorage; ++i)
_mesa_uniform_detach_all_driver_storage(&shProg->data->
UniformStorage[i]);
@@ -336,7 +336,7 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
shProg->data->UniformStorage = NULL;
}
- if (shProg->UniformRemapTable && !shProg->data->cache_fallback) {
+ if (shProg->UniformRemapTable) {
ralloc_free(shProg->UniformRemapTable);
shProg->NumUniformRemapTable = 0;
shProg->UniformRemapTable = NULL;
@@ -351,17 +351,15 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
ralloc_free(shProg->data->InfoLog);
shProg->data->InfoLog = ralloc_strdup(shProg->data, "");
- if (!shProg->data->cache_fallback) {
- ralloc_free(shProg->data->UniformBlocks);
- shProg->data->UniformBlocks = NULL;
- shProg->data->NumUniformBlocks = 0;
+ ralloc_free(shProg->data->UniformBlocks);
+ shProg->data->UniformBlocks = NULL;
+ shProg->data->NumUniformBlocks = 0;
- ralloc_free(shProg->data->ShaderStorageBlocks);
- shProg->data->ShaderStorageBlocks = NULL;
- shProg->data->NumShaderStorageBlocks = 0;
- }
+ ralloc_free(shProg->data->ShaderStorageBlocks);
+ shProg->data->ShaderStorageBlocks = NULL;
+ shProg->data->NumShaderStorageBlocks = 0;
- if (shProg->data->AtomicBuffers && !shProg->data->cache_fallback) {
+ if (shProg->data->AtomicBuffers) {
ralloc_free(shProg->data->AtomicBuffers);
shProg->data->AtomicBuffers = NULL;
shProg->data->NumAtomicBuffers = 0;
@@ -434,8 +432,7 @@ _mesa_delete_shader_program(struct gl_context *ctx,
struct gl_shader_program *shProg)
{
_mesa_free_shader_program_data(ctx, shProg);
- if (!shProg->data->cache_fallback)
- _mesa_reference_shader_program_data(ctx, &shProg->data, NULL);
+ _mesa_reference_shader_program_data(ctx, &shProg->data, NULL);
ralloc_free(shProg);
}