]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix issues from the command recorder refactoring
authorMikko Rasa <tdb@tdb.fi>
Mon, 21 Mar 2022 21:31:05 +0000 (23:31 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 21 Mar 2022 21:33:03 +0000 (23:33 +0200)
source/backends/vulkan/commands_backend.cpp

index fd95d152925e6fed3cb2866a473a0f1f2338491b..777d1a6b8b3a17a7ca882c2e9f0a4ea5f82433bf 100644 (file)
@@ -149,7 +149,7 @@ void VulkanCommands::begin_render_pass(bool clear, const ClearValue *clear_value
 void VulkanCommands::end_render_pass()
 {
        const VulkanFunctions &vk = device.get_functions();
-       VulkanCommandRecorder vkCmd(vk, pass_buffer);
+       VulkanCommandRecorder vkCmd(vk, primary_buffer);
 
        vk.EndCommandBuffer(pass_buffer);
 
@@ -253,12 +253,11 @@ void VulkanCommands::draw_instanced(const Batch &batch, unsigned count)
        if(!pipeline_state)
                throw invalid_operation("VulkanCommands::draw_instanced");
 
-       const VulkanFunctions &vk = device.get_functions();
-       VulkanCommandRecorder vkCmd(vk, pass_buffer);
-
        if(!framebuffer)
                 begin_render_pass(false, 0);
 
+       VulkanCommandRecorder vkCmd(device.get_functions(), pass_buffer);
+
        pipeline_state->refresh();
        pipeline_state->apply(vkCmd, last_pipeline, frame_index, fb_is_swapchain);
        last_pipeline = pipeline_state;