]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/pipelinestate_backend.cpp
Minor, largely cosmetic tweaks
[libs/gl.git] / source / backends / vulkan / pipelinestate_backend.cpp
index efa08a8634ecf15b755b459121f629a2682da529..1d381022ace90136fc193681d97361a3b5f3d063 100644 (file)
@@ -35,17 +35,17 @@ void VulkanPipelineState::update() const
 {
        const PipelineState &self = *static_cast<const PipelineState *>(this);
 
-       if(self.changes&PipelineState::VERTEX_SETUP)
+       if(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)
+       if(changes&pipeline_mask)
                handle = device.get_pipeline_cache().get_pipeline(self);
 
-       if(self.changes&(PipelineState::SHPROG|PipelineState::UNIFORMS|PipelineState::TEXTURES))
+       if(changes&(PipelineState::SHPROG|PipelineState::UNIFORMS|PipelineState::TEXTURES))
        {
-               unsigned changed_sets = (self.changes&PipelineState::SHPROG ? ~0U : 0U);
+               unsigned changed_sets = (changes&PipelineState::SHPROG ? ~0U : 0U);
                for(const PipelineState::BoundUniformBlock &u: self.uniform_blocks)
                        if(u.changed || changed_sets==~0U)
                        {
@@ -68,13 +68,16 @@ void VulkanPipelineState::update() const
                                t.changed = false;
                        }
 
-               descriptor_set_handles.resize(self.shprog->get_n_descriptor_sets());
-               for(unsigned i=0; i<descriptor_set_handles.size(); ++i)
-                       if(changed_sets&(1<<i))
-                               descriptor_set_handles[i] = device.get_pipeline_cache().get_descriptor_set(self, i);
+               if(changed_sets)
+               {
+                       descriptor_set_handles.resize(self.shprog->get_n_descriptor_sets());
+                       for(unsigned i=0; i<descriptor_set_handles.size(); ++i)
+                               if(changed_sets&(1<<i))
+                                       descriptor_set_handles[i] = device.get_pipeline_cache().get_descriptor_set(self, i);
+               }
        }
 
-       self.changes = 0;
+       changes = 0;
 }
 
 uint64_t VulkanPipelineState::compute_hash() const