From 37076ae3c42e963d8ee90e54f06da1227d85129f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 22 Nov 2021 01:23:13 +0200 Subject: [PATCH] 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). --- source/backends/vulkan/pipelinestate_backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.43.0