]> git.tdb.fi Git - libs/gl.git/commitdiff
Move PipelineState refresh to just before draw call
authorMikko Rasa <tdb@tdb.fi>
Sun, 21 Nov 2021 23:29:09 +0000 (01:29 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 21 Nov 2021 23:44:36 +0000 (01:44 +0200)
Shouldn't matter much, but it makes more sense here

source/backends/vulkan/commands_backend.cpp

index a5f2ceb5ad9dcd38789c14801cf0ca759a83b2ce..84bc104a3e372fd1f19832d8a9a52562ec7411c4 100644 (file)
@@ -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);