From e91e8eef41aad4567476d9b7356c1bfb4886a193 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 3 Jun 2025 10:49:14 +0200 Subject: [PATCH] Refactor: Vulkan: Use VKDevice& in finalize_pipeline_layout !139630 requires the VKDevice to access the device function pointers. --- source/blender/gpu/vulkan/vk_shader.cc | 6 +++--- source/blender/gpu/vulkan/vk_shader.hh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/gpu/vulkan/vk_shader.cc b/source/blender/gpu/vulkan/vk_shader.cc index 258b3fb2619..9f43797921c 100644 --- a/source/blender/gpu/vulkan/vk_shader.cc +++ b/source/blender/gpu/vulkan/vk_shader.cc @@ -617,7 +617,7 @@ bool VKShader::finalize(const shader::ShaderCreateInfo *info) if (!finalize_descriptor_set_layouts(device, vk_interface)) { return false; } - if (!finalize_pipeline_layout(device.vk_handle(), vk_interface)) { + if (!finalize_pipeline_layout(device, vk_interface)) { return false; } @@ -682,7 +682,7 @@ bool VKShader::is_ready() const return compilation_finished; } -bool VKShader::finalize_pipeline_layout(VkDevice vk_device, +bool VKShader::finalize_pipeline_layout(VKDevice &device, const VKShaderInterface &shader_interface) { const uint32_t layout_count = vk_descriptor_set_layout_ == VK_NULL_HANDLE ? 0 : 1; @@ -705,7 +705,7 @@ bool VKShader::finalize_pipeline_layout(VkDevice vk_device, pipeline_info.pPushConstantRanges = &push_constant_range; } - if (vkCreatePipelineLayout(vk_device, &pipeline_info, nullptr, &vk_pipeline_layout) != + if (vkCreatePipelineLayout(device.vk_handle(), &pipeline_info, nullptr, &vk_pipeline_layout) != VK_SUCCESS) { return false; diff --git a/source/blender/gpu/vulkan/vk_shader.hh b/source/blender/gpu/vulkan/vk_shader.hh index e92d5929ebe..63ca737da5b 100644 --- a/source/blender/gpu/vulkan/vk_shader.hh +++ b/source/blender/gpu/vulkan/vk_shader.hh @@ -122,7 +122,7 @@ class VKShader : public Shader { bool finalize_shader_module(VKShaderModule &shader_module, const char *stage_name); bool finalize_descriptor_set_layouts(VKDevice &vk_device, const VKShaderInterface &shader_interface); - bool finalize_pipeline_layout(VkDevice vk_device, const VKShaderInterface &shader_interface); + bool finalize_pipeline_layout(VKDevice &device, const VKShaderInterface &shader_interface); /** * \brief features available on newer implementation such as native barycentric coordinates