]> git.tdb.fi Git - libs/gl.git/commitdiff
Refresh vertex setup in VulkanPipelineState::update
authorMikko Rasa <tdb@tdb.fi>
Thu, 9 Dec 2021 09:50:42 +0000 (11:50 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 9 Dec 2021 09:50:42 +0000 (11:50 +0200)
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

index 4f4f5600bb08cd7c0c19a575adaa7ad26cd934f3..892348214790573832989baa7ea6de790b418139 100644 (file)
@@ -35,6 +35,9 @@ void VulkanPipelineState::update() const
 {
        const PipelineState &self = *static_cast<const PipelineState *>(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<char> &buffer) const
        }
 
        if(self.vertex_setup)
-       {
-               self.vertex_setup->refresh();
                pipeline_info->pVertexInputState = reinterpret_cast<const VkPipelineVertexInputStateCreateInfo *>(self.vertex_setup->creation_info.data());
-       }
 }
 
 uint64_t VulkanPipelineState::compute_descriptor_set_hash(unsigned index) const