Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HansKristian-Work/vkd3d-proton.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-03-18 19:20:10 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-09-14 13:52:31 +0300
commit7bac2e613e39c3b51bec99f4a91d4ef334111c65 (patch)
tree69d69c89fbf264509000463682b61928a501d2aa
parentf73315c57fefb8453a3fd931c4e97f1ed13e1686 (diff)
vkd3d: Streamline vkd3d_create_compute_pipeline.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
-rw-r--r--libs/vkd3d/state.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c
index 6daf47d9..4b1cc16c 100644
--- a/libs/vkd3d/state.c
+++ b/libs/vkd3d/state.c
@@ -2442,9 +2442,7 @@ static void vkd3d_report_pipeline_creation_feedback_results(const VkPipelineCrea
static HRESULT vkd3d_create_compute_pipeline(struct d3d12_pipeline_state *state,
struct d3d12_device *device,
- const D3D12_SHADER_BYTECODE *code,
- VkPipelineLayout vk_pipeline_layout, VkPipelineCache vk_cache, VkPipeline *vk_pipeline,
- struct vkd3d_shader_code *spirv_code)
+ const D3D12_SHADER_BYTECODE *code)
{
VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT required_subgroup_size_info;
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
@@ -2453,9 +2451,14 @@ static HRESULT vkd3d_create_compute_pipeline(struct d3d12_pipeline_state *state,
VkPipelineCreationFeedbackEXT feedbacks[1];
VkComputePipelineCreateInfo pipeline_info;
VkPipelineCreationFeedbackEXT feedback;
+ struct vkd3d_shader_code *spirv_code;
+ VkPipelineCache vk_cache;
VkResult vr;
HRESULT hr;
+ vk_cache = state->vk_pso_cache;
+ spirv_code = &state->compute.code;
+
pipeline_info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
pipeline_info.pNext = NULL;
pipeline_info.flags = 0;
@@ -2464,7 +2467,7 @@ static HRESULT vkd3d_create_compute_pipeline(struct d3d12_pipeline_state *state,
VK_SHADER_STAGE_COMPUTE_BIT, &required_subgroup_size_info,
code, spirv_code)))
return hr;
- pipeline_info.layout = vk_pipeline_layout;
+ pipeline_info.layout = state->root_signature->compute.vk_pipeline_layout;
pipeline_info.basePipelineHandle = VK_NULL_HANDLE;
pipeline_info.basePipelineIndex = -1;
@@ -2490,7 +2493,7 @@ static HRESULT vkd3d_create_compute_pipeline(struct d3d12_pipeline_state *state,
feedback_info.pipelineStageCreationFeedbackCount = 0;
vr = VK_CALL(vkCreateComputePipelines(device->vk_device,
- vk_cache, 1, &pipeline_info, NULL, vk_pipeline));
+ vk_cache, 1, &pipeline_info, NULL, &state->compute.vk_pipeline));
TRACE("Called vkCreateComputePipelines.\n");
VK_CALL(vkDestroyShaderModule(device->vk_device, pipeline_info.stage.module, NULL));
@@ -2530,12 +2533,7 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st
vkd3d_load_spirv_from_cached_state(device, cached_pso,
VK_SHADER_STAGE_COMPUTE_BIT, &state->compute.code);
- hr = vkd3d_create_compute_pipeline(state, device,
- &desc->cs,
- state->root_signature->compute.vk_pipeline_layout,
- state->vk_pso_cache,
- &state->compute.vk_pipeline,
- &state->compute.code);
+ hr = vkd3d_create_compute_pipeline(state, device, &desc->cs);
if (FAILED(hr))
{