| Index: gpu/vulkan/vulkan_swap_chain.cc
|
| diff --git a/gpu/vulkan/vulkan_swap_chain.cc b/gpu/vulkan/vulkan_swap_chain.cc
|
| index a42e26ed9d8234db8ad8f180093604f93f24127d..030595602a59439232578c3455e267b3012866a8 100644
|
| --- a/gpu/vulkan/vulkan_swap_chain.cc
|
| +++ b/gpu/vulkan/vulkan_swap_chain.cc
|
| @@ -203,13 +203,27 @@ bool VulkanSwapChain::InitializeSwapImages(
|
| // Initialize the command buffer for this buffer data.
|
| image_data->command_buffer = command_pool_->CreatePrimaryCommandBuffer();
|
|
|
| - // Setup the Image Layout as the first command that gets issued in each
|
| - // command buffer.
|
| - ScopedSingleUseCommandBufferRecorder recorder(*image_data->command_buffer);
|
| - image_memory_barrier.image = images[i];
|
| - vkCmdPipelineBarrier(recorder.handle(), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
|
| - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0,
|
| - nullptr, 1, &image_memory_barrier);
|
| + {
|
| + // Setup the Image Layout as the first command that gets issued in each
|
| + // command buffer.
|
| + ScopedSingleUseCommandBufferRecorder recorder(
|
| + *image_data->command_buffer);
|
| + image_memory_barrier.image = images[i];
|
| + vkCmdPipelineBarrier(recorder.handle(), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
|
| + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0,
|
| + nullptr, 1, &image_memory_barrier);
|
| +
|
| + VkClearColorValue clear_color = { { 0.0f, 0.0f, 0.0f, 0.0f } };
|
| + vkCmdClearColorImage(recorder.handle(), images[i],
|
| + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
| + &clear_color, 1, &image_subresource_range);
|
| + }
|
| +
|
| + // First submit to fill the image memory.
|
| + if (!image_data->command_buffer->Submit(0, VK_NULL_HANDLE,
|
| + 1, &image_data->render_semaphore)) {
|
| + return false;
|
| + }
|
|
|
| // Create the image view.
|
| image_data->image_view.reset(new VulkanImageView(device_queue_));
|
|
|