]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/commands_backend.cpp
Apply only changed parts of VulkanPipelineState
[libs/gl.git] / source / backends / vulkan / commands_backend.cpp
index d655134d032fdf95cf05fe6a5d7941868cd2c341..8f32e0b024bd9c0264e8376331eceffca1105eff 100644 (file)
@@ -78,6 +78,7 @@ void VulkanCommands::begin_buffer(VkRenderPass render_pass)
        }
 
        vk.BeginCommandBuffer(buffer, begin_info);
+       last_pipeline = 0;
 }
 
 void VulkanCommands::begin_render_pass(bool clear, const ClearValue *clear_values)
@@ -255,7 +256,8 @@ void VulkanCommands::draw_instanced(const Batch &batch, unsigned count)
                 begin_render_pass(false, 0);
 
        pipeline_state->refresh();
-       pipeline_state->apply(pass_buffer, frame_index, fb_is_swapchain);
+       pipeline_state->apply(pass_buffer, last_pipeline, frame_index, fb_is_swapchain);
+       last_pipeline = pipeline_state;
        unsigned first_index = batch.get_offset()/batch.get_index_size();
        vk.CmdDrawIndexed(pass_buffer, batch.size(), count, first_index, 0, 0);
 }