]> git.tdb.fi Git - libs/gl.git/commitdiff
Always apply push constants
authorMikko Rasa <tdb@tdb.fi>
Sun, 21 Nov 2021 23:23:13 +0000 (01:23 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 21 Nov 2021 23:44:36 +0000 (01:44 +0200)
The changed flag is no longer valid at this point.  This could in theory
result in unnecessary CmdPushConstants calls, but in practice they change
for every draw call (if they're used in the first place).

source/backends/vulkan/pipelinestate_backend.cpp

index 4a47b223d992c31ead569b39d49e441bbc76f633..4714ff67015a1fe736d3459f1375f8a39ccd4677 100644 (file)
@@ -326,7 +326,7 @@ void VulkanPipelineState::apply(VkCommandBuffer command_buffer) const
        if(!self.uniform_blocks.empty())
        {
                const PipelineState::BoundUniformBlock &first_block = self.uniform_blocks.front();
-               if(first_block.used && first_block.binding==ReflectData::PUSH_CONSTANT && first_block.changed)
+               if(first_block.used && first_block.binding==ReflectData::PUSH_CONSTANT)
                {
                        const UniformBlock &pc_block = *first_block.block;
                        vk.CmdPushConstants(command_buffer, self.shprog->layout_handle, VK_SHADER_STAGE_ALL,