X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fcommands_backend.cpp;h=684f0a476b723172b5ea7bcfe190ad9c465bf7bd;hb=0bcebf9930e4baada774a16c0e7637a22a410bb4;hp=0134474b932d060e6a97eb8a4bd6d97f1fb0eadb;hpb=d8d4c2aeaf109ab7ba55888bef5364fe11b5b02d;p=libs%2Fgl.git diff --git a/source/backends/vulkan/commands_backend.cpp b/source/backends/vulkan/commands_backend.cpp index 0134474b..684f0a47 100644 --- a/source/backends/vulkan/commands_backend.cpp +++ b/source/backends/vulkan/commands_backend.cpp @@ -55,7 +55,7 @@ void VulkanCommands::begin_buffer() vk.BeginCommandBuffer(current_buffer, begin_info); } -void VulkanCommands::begin_render_pass(const ClearValue *clear_values) +void VulkanCommands::begin_render_pass(bool clear, const ClearValue *clear_values) { const Framebuffer *target = pipeline_state->get_framebuffer(); if(!target) @@ -69,7 +69,7 @@ void VulkanCommands::begin_render_pass(const ClearValue *clear_values) device.get_transfer_queue().dispatch_transfers(current_buffer); // TODO Use proper value for to_present - render_pass = device.get_pipeline_cache().get_render_pass(target->get_format(), clear_values, true); + VkRenderPass render_pass = device.get_pipeline_cache().get_render_pass(target->get_format(), clear, !clear_values, true); target->refresh(); @@ -194,7 +194,7 @@ void VulkanCommands::clear(const ClearValue *values) if(render_pass) throw invalid_operation("VulkanCommands::clear"); - begin_render_pass(values); + begin_render_pass(true, values); } void VulkanCommands::draw(const Batch &batch) @@ -210,7 +210,7 @@ void VulkanCommands::draw_instanced(const Batch &batch, unsigned count) const VulkanFunctions &vk = device.get_functions(); if(!render_pass) - begin_render_pass(0); + begin_render_pass(false, 0); pipeline_state->apply(current_buffer); unsigned first_index = batch.get_offset()/batch.get_index_size();