From: Mikko Rasa Date: Sun, 21 Nov 2021 23:23:13 +0000 (+0200) Subject: Always apply push constants X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=37076ae3c42e963d8ee90e54f06da1227d85129f;p=libs%2Fgl.git Always apply push constants 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). --- diff --git a/source/backends/vulkan/pipelinestate_backend.cpp b/source/backends/vulkan/pipelinestate_backend.cpp index 4a47b223..4714ff67 100644 --- a/source/backends/vulkan/pipelinestate_backend.cpp +++ b/source/backends/vulkan/pipelinestate_backend.cpp @@ -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,