]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/pipelinestate_backend.cpp
Update all descriptor sets when the used shader changes
[libs/gl.git] / source / backends / vulkan / pipelinestate_backend.cpp
index 080a4a5d8590c52491fdbf5a5671709b32fd1c7c..32672ec42970b2a5599409375eb9ffcb48c88d4b 100644 (file)
@@ -40,9 +40,9 @@ void VulkanPipelineState::update() const
        if(self.changes&pipeline_mask)
                handle = device.get_pipeline_cache().get_pipeline(self);
 
-       if(self.changes&(PipelineState::UNIFORMS|PipelineState::TEXTURES))
+       if(self.changes&(PipelineState::SHPROG|PipelineState::UNIFORMS|PipelineState::TEXTURES))
        {
-               unsigned changed_sets = 0;
+               unsigned changed_sets = (self.changes&PipelineState::SHPROG ? ~0U : 0U);
                for(const PipelineState::BoundUniformBlock &u: self.uniform_blocks)
                        if(u.changed && u.binding>=0)
                        {
@@ -208,6 +208,11 @@ void VulkanPipelineState::fill_creation_info(vector<char> &buffer) const
                        blend_attachments[i].colorWriteMask = get_vulkan_color_mask(blend->write_mask);
                }
        }
+       else
+       {
+               for(unsigned i=0; i<n_color_attachments; ++i)
+                       blend_attachments[i].colorWriteMask = VK_COLOR_COMPONENT_R_BIT|VK_COLOR_COMPONENT_G_BIT|VK_COLOR_COMPONENT_B_BIT|VK_COLOR_COMPONENT_A_BIT;
+       }
 
        blend_info->sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
        blend_info->attachmentCount = n_color_attachments;