aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-04-24 19:54:14 -0500
committerJason Ekstrand <[email protected]>2019-08-12 22:56:07 +0000
commit651fbbf9b8e522d6f3e7be9345590e52e5baf4db (patch)
tree78a9f7cf287ce1bb3eab4eb5cb7fd3f35b5253ae /src/intel
parent78f3dfb4a23b6d118e6c33ecdc5a9cdbcc551e4d (diff)
anv/pipeline: Split setting up per-stage keys into its own loop
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_pipeline.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 323a7894e99..c1941ecfe04 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -1135,6 +1135,14 @@ anv_pipeline_compile_graphics(struct anv_pipeline *pipeline,
unsigned char sha1[20];
anv_pipeline_hash_graphics(pipeline, layout, stages, sha1);
+ for (unsigned s = 0; s < MESA_SHADER_STAGES; s++) {
+ if (!stages[s].entrypoint)
+ continue;
+
+ stages[s].cache_key.stage = s;
+ memcpy(stages[s].cache_key.sha1, sha1, sizeof(sha1));
+ }
+
unsigned found = 0;
unsigned cache_hits = 0;
for (unsigned s = 0; s < MESA_SHADER_STAGES; s++) {
@@ -1143,9 +1151,6 @@ anv_pipeline_compile_graphics(struct anv_pipeline *pipeline,
int64_t stage_start = os_time_get_nano();
- stages[s].cache_key.stage = s;
- memcpy(stages[s].cache_key.sha1, sha1, sizeof(sha1));
-
bool cache_hit;
struct anv_shader_bin *bin =
anv_device_search_for_kernel(pipeline->device, cache,