From: Mikko Rasa Date: Thu, 9 Dec 2021 09:50:42 +0000 (+0200) Subject: Refresh vertex setup in VulkanPipelineState::update X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7b59f9eb7120bf31afded9105aba8163a4381e5b;p=libs%2Fgl.git 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. --- 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