From: Mikko Rasa Date: Sun, 21 Nov 2021 23:29:09 +0000 (+0200) Subject: Move PipelineState refresh to just before draw call X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=bbdf52425b736a59d01dda215458c3a1c9bdb320 Move PipelineState refresh to just before draw call Shouldn't matter much, but it makes more sense here --- diff --git a/source/backends/vulkan/commands_backend.cpp b/source/backends/vulkan/commands_backend.cpp index a5f2ceb5..84bc104a 100644 --- a/source/backends/vulkan/commands_backend.cpp +++ b/source/backends/vulkan/commands_backend.cpp @@ -195,8 +195,6 @@ void VulkanCommands::use_pipeline(const PipelineState *ps) end_render_pass(); pipeline_state = ps; - if(pipeline_state) - pipeline_state->refresh(); } void VulkanCommands::clear(const ClearValue *values) @@ -222,6 +220,7 @@ void VulkanCommands::draw_instanced(const Batch &batch, unsigned count) if(!framebuffer) begin_render_pass(false, 0); + pipeline_state->refresh(); pipeline_state->apply(current_buffer); unsigned first_index = batch.get_offset()/batch.get_index_size(); vk.CmdDrawIndexed(current_buffer, batch.size(), count, first_index, 0, 0);