From 7ba7f43e837fce342aa01b456558dda887615194 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 18 Apr 2022 10:50:09 +0100 Subject: [PATCH] a/vk: Add specialization_info argument to vk_create_compute_pipeline --- src/xrt/auxiliary/vk/vk_helpers.h | 1 + src/xrt/auxiliary/vk/vk_state_creators.c | 2 ++ src/xrt/compositor/render/render_resources.c | 3 +++ 3 files changed, 6 insertions(+) diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index c7791f3fb..ac9aab8f5 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -938,6 +938,7 @@ vk_create_compute_pipeline(struct vk_bundle *vk, VkPipelineCache pipeline_cache, VkShaderModule shader, VkPipelineLayout pipeline_layout, + const VkSpecializationInfo *specialization_info, VkPipeline *out_compute_pipeline); diff --git a/src/xrt/auxiliary/vk/vk_state_creators.c b/src/xrt/auxiliary/vk/vk_state_creators.c index 3e5164f31..b44a94f38 100644 --- a/src/xrt/auxiliary/vk/vk_state_creators.c +++ b/src/xrt/auxiliary/vk/vk_state_creators.c @@ -173,6 +173,7 @@ vk_create_compute_pipeline(struct vk_bundle *vk, VkPipelineCache pipeline_cache, VkShaderModule shader, VkPipelineLayout pipeline_layout, + const VkSpecializationInfo *specialization_info, VkPipeline *out_compute_pipeline) { VkResult ret; @@ -183,6 +184,7 @@ vk_create_compute_pipeline(struct vk_bundle *vk, .stage = VK_SHADER_STAGE_COMPUTE_BIT, .module = shader, .pName = "main", + .pSpecializationInfo = specialization_info, }; VkComputePipelineCreateInfo pipeline_info = { diff --git a/src/xrt/compositor/render/render_resources.c b/src/xrt/compositor/render/render_resources.c index 485788fcd..b836fe03d 100644 --- a/src/xrt/compositor/render/render_resources.c +++ b/src/xrt/compositor/render/render_resources.c @@ -651,6 +651,7 @@ render_resources_init(struct render_resources *r, r->pipeline_cache, // pipeline_cache r->shaders->clear_comp, // shader r->compute.pipeline_layout, // pipeline_layout + NULL, // specialization_info &r->compute.clear_pipeline)); // out_compute_pipeline C(vk_create_compute_pipeline( // @@ -658,6 +659,7 @@ render_resources_init(struct render_resources *r, r->pipeline_cache, // pipeline_cache r->shaders->distortion_comp, // shader r->compute.pipeline_layout, // pipeline_layout + NULL, // specialization_info &r->compute.distortion_pipeline)); // out_compute_pipeline C(vk_create_compute_pipeline( // @@ -665,6 +667,7 @@ render_resources_init(struct render_resources *r, r->pipeline_cache, // pipeline_cache r->shaders->distortion_timewarp_comp, // shader r->compute.pipeline_layout, // pipeline_layout + NULL, // specialization_info &r->compute.distortion_timewarp_pipeline)); // out_compute_pipeline