summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Piñeiro <apinheiro@igalia.com>2019-02-27 15:29:15 +0100
committerAlejandro Piñeiro <apinheiro@igalia.com>2019-07-12 23:42:41 +0200
commitbb3bbdfbbdb3eb1d4750ffcb2e6827a01872fdab (patch)
tree5979559acd5124af4da1d5edbd96f589f8941105
parent637b168470190507c89eca8a7d0479103fe236ae (diff)
glsl/shader_cache: handle SPIR-V shaders
Right now we don't have cache support for SPIR-V shaders (from ARB_gl_spirv). Right now they are properly skipped because they fall on the ff shader code path (no key, no name), but it would be better to update current comments, and add some guards. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
-rw-r--r--src/compiler/glsl/shader_cache.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index 97049043345..aacaa46748e 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -90,10 +90,10 @@ shader_cache_write_program_metadata(struct gl_context *ctx,
return;
/* Exit early when we are dealing with a ff shader with no source file to
- * generate a source from.
+ * generate a source from, or with a SPIR-V shader.
*
* TODO: In future we should use another method to generate a key for ff
- * programs.
+ * programs, and SPIR-V shaders.
*/
static const char zero[sizeof(prog->data->sha1)] = {0};
if (memcmp(prog->data->sha1, zero, sizeof(prog->data->sha1)) == 0)
@@ -144,10 +144,10 @@ bool
shader_cache_read_program_metadata(struct gl_context *ctx,
struct gl_shader_program *prog)
{
- /* Fixed function programs generated by Mesa are not cached. So don't
- * try to read metadata for them from the cache.
+ /* Fixed function programs generated by Mesa, or SPIR-V shaders, are not
+ * cached. So don't try to read metadata for them from the cache.
*/
- if (prog->Name == 0)
+ if (prog->Name == 0 || prog->data->spirv)
return false;
struct disk_cache *cache = ctx->Cache;