From 7b59f9eb7120bf31afded9105aba8163a4381e5b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 9 Dec 2021 11:50:42 +0200 Subject: [PATCH] Refresh vertex setup in VulkanPipelineState::update The buffers and offsets must be filled even if another vertex setup with the same format has been used before. --- source/backends/vulkan/pipelinestate_backend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/backends/vulkan/pipelinestate_backend.cpp b/source/backends/vulkan/pipelinestate_backend.cpp index 4f4f5600..89234821 100644 --- a/source/backends/vulkan/pipelinestate_backend.cpp +++ b/source/backends/vulkan/pipelinestate_backend.cpp @@ -35,6 +35,9 @@ void VulkanPipelineState::update() const { const PipelineState &self = *static_cast(this); + if(self.changes&PipelineState::VERTEX_SETUP) + self.vertex_setup->refresh(); + constexpr unsigned pipeline_mask = PipelineState::SHPROG|PipelineState::VERTEX_SETUP|PipelineState::FACE_CULL| PipelineState::DEPTH_TEST|PipelineState::STENCIL_TEST|PipelineState::BLEND|PipelineState::PRIMITIVE_TYPE; if(self.changes&pipeline_mask) @@ -257,10 +260,7 @@ void VulkanPipelineState::fill_creation_info(vector &buffer) const } if(self.vertex_setup) - { - self.vertex_setup->refresh(); pipeline_info->pVertexInputState = reinterpret_cast(self.vertex_setup->creation_info.data()); - } } uint64_t VulkanPipelineState::compute_descriptor_set_hash(unsigned index) const -- 2.45.2