aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_pipeline.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-10-13 12:22:24 +1100
committerTimothy Arceri <[email protected]>2017-10-18 09:19:35 +1100
commitdbbf10541b134253a576da23ea6b3c6a5afc0dc8 (patch)
tree10e827042411be86b1855dc90c567a899a06dc7b /src/amd/vulkan/radv_pipeline.c
parent351f9dde600d31ab7985b595e50a15c178516c79 (diff)
radv: reuse the multiple shader store & load functions for gs copy variant
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pipeline.c')
-rw-r--r--src/amd/vulkan/radv_pipeline.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 4bb9fbb15b8..e95925fda58 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1551,11 +1551,9 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
gs_copy_hash[0] ^= 1;
if (modules[MESA_SHADER_GEOMETRY]) {
- pipeline->gs_copy_shader =
- radv_create_shader_variant_from_pipeline_cache(
- pipeline->device,
- cache,
- gs_copy_hash);
+ struct radv_shader_variant *variants[MESA_SHADER_STAGES] = {0};
+ radv_create_shader_variants_from_pipeline_cache(device, cache, gs_copy_hash, variants);
+ pipeline->gs_copy_shader = variants[MESA_SHADER_GEOMETRY];
}
if (radv_create_shader_variants_from_pipeline_cache(device, cache, hash, pipeline->shaders) &&
@@ -1629,12 +1627,19 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
}
if (pipeline->gs_copy_shader) {
- pipeline->gs_copy_shader =
- radv_pipeline_cache_insert_shader(device, cache,
- gs_copy_hash,
- pipeline->gs_copy_shader,
- gs_copy_code,
- gs_copy_code_size);
+ void *code[MESA_SHADER_STAGES] = {0};
+ unsigned code_size[MESA_SHADER_STAGES] = {0};
+ struct radv_shader_variant *variants[MESA_SHADER_STAGES] = {0};
+
+ code[MESA_SHADER_GEOMETRY] = gs_copy_code;
+ code_size[MESA_SHADER_GEOMETRY] = gs_copy_code_size;
+ variants[MESA_SHADER_GEOMETRY] = pipeline->gs_copy_shader;
+
+ radv_pipeline_cache_insert_shaders(device, cache,
+ gs_copy_hash,
+ variants,
+ (const void**)code,
+ code_size);
}
free(gs_copy_code);
}