Commit aa09ca69 by Jamie Madill Committed by Commit Bot

Vulkan: Update ContextVk command buffer access methods.

Use the following names: - flushAndBeginRenderPass - endRenderPassAndGetCommandBuffer - flushAndGetPrimaryCommandBuffer This clarifies that a flush is part of the method. Bug: angleproject:4029 Change-Id: I6c870761339ea7aa39c83142200781ba39ad6a4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2068129 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent 4dc19c38
...@@ -210,7 +210,7 @@ angle::Result BufferVk::copySubData(const gl::Context *context, ...@@ -210,7 +210,7 @@ angle::Result BufferVk::copySubData(const gl::Context *context,
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_TRANSFER_READ_BIT, &sourceBuffer->getBuffer())); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_TRANSFER_READ_BIT, &sourceBuffer->getBuffer()));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_TRANSFER_WRITE_BIT, &mBuffer)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_TRANSFER_WRITE_BIT, &mBuffer));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
// Enqueue a copy command on the GPU. // Enqueue a copy command on the GPU.
const VkBufferCopy copyRegion = {static_cast<VkDeviceSize>(sourceOffset), const VkBufferCopy copyRegion = {static_cast<VkDeviceSize>(sourceOffset),
...@@ -395,7 +395,7 @@ angle::Result BufferVk::copyToBuffer(ContextVk *contextVk, ...@@ -395,7 +395,7 @@ angle::Result BufferVk::copyToBuffer(ContextVk *contextVk,
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_TRANSFER_WRITE_BIT, destBuffer)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_TRANSFER_WRITE_BIT, destBuffer));
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_TRANSFER_READ_BIT, &mBuffer)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_TRANSFER_READ_BIT, &mBuffer));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
commandBuffer->copyBuffer(mBuffer.getBuffer(), destBuffer->getBuffer(), copyCount, copies); commandBuffer->copyBuffer(mBuffer.getBuffer(), destBuffer->getBuffer(), copyCount, copies);
......
...@@ -2211,7 +2211,7 @@ angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker) ...@@ -2211,7 +2211,7 @@ angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker)
return angle::Result::Continue; return angle::Result::Continue;
vk::PrimaryCommandBuffer *primary; vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(getPrimaryCommandBuffer(&primary)); ANGLE_TRY(flushAndGetPrimaryCommandBuffer(&primary));
VkDebugUtilsLabelEXT label; VkDebugUtilsLabelEXT label;
vk::MakeDebugUtilsLabel(GL_DEBUG_SOURCE_APPLICATION, marker, &label); vk::MakeDebugUtilsLabel(GL_DEBUG_SOURCE_APPLICATION, marker, &label);
...@@ -2226,7 +2226,7 @@ angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker) ...@@ -2226,7 +2226,7 @@ angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker)
return angle::Result::Continue; return angle::Result::Continue;
vk::PrimaryCommandBuffer *primary; vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(getPrimaryCommandBuffer(&primary)); ANGLE_TRY(flushAndGetPrimaryCommandBuffer(&primary));
VkDebugUtilsLabelEXT label; VkDebugUtilsLabelEXT label;
vk::MakeDebugUtilsLabel(GL_DEBUG_SOURCE_APPLICATION, marker, &label); vk::MakeDebugUtilsLabel(GL_DEBUG_SOURCE_APPLICATION, marker, &label);
...@@ -2241,7 +2241,7 @@ angle::Result ContextVk::popGroupMarker() ...@@ -2241,7 +2241,7 @@ angle::Result ContextVk::popGroupMarker()
return angle::Result::Continue; return angle::Result::Continue;
vk::PrimaryCommandBuffer *primary; vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(getPrimaryCommandBuffer(&primary)); ANGLE_TRY(flushAndGetPrimaryCommandBuffer(&primary));
primary->endDebugUtilsLabelEXT(); primary->endDebugUtilsLabelEXT();
return angle::Result::Continue; return angle::Result::Continue;
...@@ -2256,7 +2256,7 @@ angle::Result ContextVk::pushDebugGroup(const gl::Context *context, ...@@ -2256,7 +2256,7 @@ angle::Result ContextVk::pushDebugGroup(const gl::Context *context,
return angle::Result::Continue; return angle::Result::Continue;
vk::PrimaryCommandBuffer *primary; vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(getPrimaryCommandBuffer(&primary)); ANGLE_TRY(flushAndGetPrimaryCommandBuffer(&primary));
VkDebugUtilsLabelEXT label; VkDebugUtilsLabelEXT label;
vk::MakeDebugUtilsLabel(source, message.c_str(), &label); vk::MakeDebugUtilsLabel(source, message.c_str(), &label);
...@@ -2271,7 +2271,7 @@ angle::Result ContextVk::popDebugGroup(const gl::Context *context) ...@@ -2271,7 +2271,7 @@ angle::Result ContextVk::popDebugGroup(const gl::Context *context)
return angle::Result::Continue; return angle::Result::Continue;
vk::PrimaryCommandBuffer *primary; vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(getPrimaryCommandBuffer(&primary)); ANGLE_TRY(flushAndGetPrimaryCommandBuffer(&primary));
primary->endDebugUtilsLabelEXT(); primary->endDebugUtilsLabelEXT();
return angle::Result::Continue; return angle::Result::Continue;
...@@ -3089,7 +3089,7 @@ angle::Result ContextVk::memoryBarrierImpl(GLbitfield barriers, VkPipelineStageF ...@@ -3089,7 +3089,7 @@ angle::Result ContextVk::memoryBarrierImpl(GLbitfield barriers, VkPipelineStageF
} }
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(endRenderPassAndGetCommandBuffer(&commandBuffer));
VkMemoryBarrier memoryBarrier = {}; VkMemoryBarrier memoryBarrier = {};
memoryBarrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER; memoryBarrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
...@@ -3835,7 +3835,7 @@ angle::Result ContextVk::onImageRead(VkImageAspectFlags aspectFlags, ...@@ -3835,7 +3835,7 @@ angle::Result ContextVk::onImageRead(VkImageAspectFlags aspectFlags,
if (image->isLayoutChangeNecessary(imageLayout)) if (image->isLayoutChangeNecessary(imageLayout))
{ {
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(endRenderPassAndGetCommandBuffer(&commandBuffer));
image->changeLayout(aspectFlags, imageLayout, commandBuffer); image->changeLayout(aspectFlags, imageLayout, commandBuffer);
} }
image->retain(&mResourceUseList); image->retain(&mResourceUseList);
...@@ -3852,7 +3852,7 @@ angle::Result ContextVk::onImageWrite(VkImageAspectFlags aspectFlags, ...@@ -3852,7 +3852,7 @@ angle::Result ContextVk::onImageWrite(VkImageAspectFlags aspectFlags,
ASSERT(image->isLayoutChangeNecessary(imageLayout)); ASSERT(image->isLayoutChangeNecessary(imageLayout));
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(endRenderPassAndGetCommandBuffer(&commandBuffer));
image->changeLayout(aspectFlags, imageLayout, commandBuffer); image->changeLayout(aspectFlags, imageLayout, commandBuffer);
image->retain(&mResourceUseList); image->retain(&mResourceUseList);
...@@ -3860,15 +3860,16 @@ angle::Result ContextVk::onImageWrite(VkImageAspectFlags aspectFlags, ...@@ -3860,15 +3860,16 @@ angle::Result ContextVk::onImageWrite(VkImageAspectFlags aspectFlags,
return angle::Result::Continue; return angle::Result::Continue;
} }
angle::Result ContextVk::beginRenderPass(const vk::Framebuffer &framebuffer, angle::Result ContextVk::flushAndBeginRenderPass(
const gl::Rectangle &renderArea, const vk::Framebuffer &framebuffer,
const vk::RenderPassDesc &renderPassDesc, const gl::Rectangle &renderArea,
const vk::AttachmentOpsArray &renderPassAttachmentOps, const vk::RenderPassDesc &renderPassDesc,
const std::vector<VkClearValue> &clearValues, const vk::AttachmentOpsArray &renderPassAttachmentOps,
vk::CommandBuffer **commandBufferOut) const std::vector<VkClearValue> &clearValues,
vk::CommandBuffer **commandBufferOut)
{ {
vk::PrimaryCommandBuffer *primary; vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(getPrimaryCommandBuffer(&primary)); ANGLE_TRY(flushAndGetPrimaryCommandBuffer(&primary));
mRenderPassCommands.beginRenderPass(framebuffer, renderArea, renderPassDesc, mRenderPassCommands.beginRenderPass(framebuffer, renderArea, renderPassDesc,
renderPassAttachmentOps, clearValues, commandBufferOut); renderPassAttachmentOps, clearValues, commandBufferOut);
return angle::Result::Continue; return angle::Result::Continue;
...@@ -3890,7 +3891,7 @@ void ContextVk::onRenderPassImageWrite(VkImageAspectFlags aspectFlags, ...@@ -3890,7 +3891,7 @@ void ContextVk::onRenderPassImageWrite(VkImageAspectFlags aspectFlags,
angle::Result ContextVk::syncExternalMemory() angle::Result ContextVk::syncExternalMemory()
{ {
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(endRenderPassAndGetCommandBuffer(&commandBuffer));
VkMemoryBarrier memoryBarrier = {}; VkMemoryBarrier memoryBarrier = {};
memoryBarrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER; memoryBarrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
......
...@@ -591,19 +591,19 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -591,19 +591,19 @@ class ContextVk : public ContextImpl, public vk::Context
vk::ImageLayout imageLayout, vk::ImageLayout imageLayout,
vk::ImageHelper *image); vk::ImageHelper *image);
angle::Result getOutsideRenderPassCommandBuffer(vk::CommandBuffer **commandBufferOut) angle::Result endRenderPassAndGetCommandBuffer(vk::CommandBuffer **commandBufferOut)
{ {
ANGLE_TRY(endRenderPass()); ANGLE_TRY(endRenderPass());
*commandBufferOut = &mOutsideRenderPassCommands.getCommandBuffer(); *commandBufferOut = &mOutsideRenderPassCommands.getCommandBuffer();
return angle::Result::Continue; return angle::Result::Continue;
} }
angle::Result beginRenderPass(const vk::Framebuffer &framebuffer, angle::Result flushAndBeginRenderPass(const vk::Framebuffer &framebuffer,
const gl::Rectangle &renderArea, const gl::Rectangle &renderArea,
const vk::RenderPassDesc &renderPassDesc, const vk::RenderPassDesc &renderPassDesc,
const vk::AttachmentOpsArray &renderPassAttachmentOps, const vk::AttachmentOpsArray &renderPassAttachmentOps,
const std::vector<VkClearValue> &clearValues, const std::vector<VkClearValue> &clearValues,
vk::CommandBuffer **commandBufferOut); vk::CommandBuffer **commandBufferOut);
bool hasStartedRenderPass() const { return !mRenderPassCommands.empty(); } bool hasStartedRenderPass() const { return !mRenderPassCommands.empty(); }
...@@ -613,7 +613,7 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -613,7 +613,7 @@ class ContextVk : public ContextImpl, public vk::Context
return mRenderPassCommands; return mRenderPassCommands;
} }
angle::Result getPrimaryCommandBuffer(vk::PrimaryCommandBuffer **primaryCommands) angle::Result flushAndGetPrimaryCommandBuffer(vk::PrimaryCommandBuffer **primaryCommands)
{ {
mOutsideRenderPassCommands.flushToPrimary(this, &mPrimaryCommands); mOutsideRenderPassCommands.flushToPrimary(this, &mPrimaryCommands);
ANGLE_TRY(endRenderPass()); ANGLE_TRY(endRenderPass());
......
...@@ -527,7 +527,7 @@ angle::Result FramebufferVk::blitWithCommand(ContextVk *contextVk, ...@@ -527,7 +527,7 @@ angle::Result FramebufferVk::blitWithCommand(ContextVk *contextVk,
vk::CommandBuffer *commandBuffer = nullptr; vk::CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->onImageRead(imageAspectMask, vk::ImageLayout::TransferSrc, srcImage)); ANGLE_TRY(contextVk->onImageRead(imageAspectMask, vk::ImageLayout::TransferSrc, srcImage));
ANGLE_TRY(contextVk->onImageWrite(imageAspectMask, vk::ImageLayout::TransferDst, dstImage)); ANGLE_TRY(contextVk->onImageWrite(imageAspectMask, vk::ImageLayout::TransferDst, dstImage));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkImageBlit blit = {}; VkImageBlit blit = {};
blit.srcSubresource.aspectMask = blitAspectMask; blit.srcSubresource.aspectMask = blitAspectMask;
...@@ -873,7 +873,7 @@ angle::Result FramebufferVk::resolveColorWithCommand(ContextVk *contextVk, ...@@ -873,7 +873,7 @@ angle::Result FramebufferVk::resolveColorWithCommand(ContextVk *contextVk,
RenderTargetVk *drawRenderTarget = mRenderTargetCache.getColors()[colorIndexGL]; RenderTargetVk *drawRenderTarget = mRenderTargetCache.getColors()[colorIndexGL];
ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst, ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst,
&drawRenderTarget->getImage())); &drawRenderTarget->getImage()));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
resolveRegion.dstSubresource.mipLevel = drawRenderTarget->getLevelIndex(); resolveRegion.dstSubresource.mipLevel = drawRenderTarget->getLevelIndex();
resolveRegion.dstSubresource.baseArrayLayer = drawRenderTarget->getLayerIndex(); resolveRegion.dstSubresource.baseArrayLayer = drawRenderTarget->getLayerIndex();
...@@ -1343,9 +1343,9 @@ angle::Result FramebufferVk::startNewRenderPass(ContextVk *contextVk, ...@@ -1343,9 +1343,9 @@ angle::Result FramebufferVk::startNewRenderPass(ContextVk *contextVk,
attachmentClearValues.emplace_back(kUninitializedClearValue); attachmentClearValues.emplace_back(kUninitializedClearValue);
} }
return contextVk->beginRenderPass(*framebuffer, renderArea, mRenderPassDesc, return contextVk->flushAndBeginRenderPass(*framebuffer, renderArea, mRenderPassDesc,
renderPassAttachmentOps, attachmentClearValues, renderPassAttachmentOps, attachmentClearValues,
commandBufferOut); commandBufferOut);
} }
void FramebufferVk::updateActiveColorMasks(size_t colorIndexGL, bool r, bool g, bool b, bool a) void FramebufferVk::updateActiveColorMasks(size_t colorIndexGL, bool r, bool g, bool b, bool a)
......
...@@ -124,7 +124,7 @@ angle::Result OverlayVk::createFont(ContextVk *contextVk) ...@@ -124,7 +124,7 @@ angle::Result OverlayVk::createFont(ContextVk *contextVk)
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_TRANSFER_READ_BIT, &fontDataBuffer.get())); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_TRANSFER_READ_BIT, &fontDataBuffer.get()));
ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst, ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst,
&mFontImage)); &mFontImage));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&fontDataUpload)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&fontDataUpload));
VkBufferImageCopy copy = {}; VkBufferImageCopy copy = {};
copy.bufferRowLength = gl::overlay::kFontImageWidth; copy.bufferRowLength = gl::overlay::kFontImageWidth;
......
...@@ -145,7 +145,7 @@ angle::Result RenderTargetVk::flushStagedUpdates(ContextVk *contextVk) ...@@ -145,7 +145,7 @@ angle::Result RenderTargetVk::flushStagedUpdates(ContextVk *contextVk)
return angle::Result::Continue; return angle::Result::Continue;
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
return mImage->flushStagedUpdates(contextVk, mLevelIndex, mLevelIndex + 1, mLayerIndex, return mImage->flushStagedUpdates(contextVk, mLevelIndex, mLevelIndex + 1, mLayerIndex,
mLayerIndex + 1, commandBuffer); mLayerIndex + 1, commandBuffer);
} }
......
...@@ -126,7 +126,7 @@ angle::Result RenderbufferVk::setStorageEGLImageTarget(const gl::Context *contex ...@@ -126,7 +126,7 @@ angle::Result RenderbufferVk::setStorageEGLImageTarget(const gl::Context *contex
if (mImage->isQueueChangeNeccesary(rendererQueueFamilyIndex)) if (mImage->isQueueChangeNeccesary(rendererQueueFamilyIndex))
{ {
vk::CommandBuffer *commandBuffer = nullptr; vk::CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
mImage->changeLayoutAndQueue(aspect, vk::ImageLayout::ColorAttachment, mImage->changeLayoutAndQueue(aspect, vk::ImageLayout::ColorAttachment,
rendererQueueFamilyIndex, commandBuffer); rendererQueueFamilyIndex, commandBuffer);
} }
......
...@@ -118,7 +118,7 @@ angle::Result SemaphoreVk::wait(gl::Context *context, ...@@ -118,7 +118,7 @@ angle::Result SemaphoreVk::wait(gl::Context *context,
vk::BufferHelper &bufferHelper = bufferVk->getBuffer(); vk::BufferHelper &bufferHelper = bufferVk->getBuffer();
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
// Queue ownership transfer. // Queue ownership transfer.
bufferHelper.changeQueue(rendererQueueFamilyIndex, commandBuffer); bufferHelper.changeQueue(rendererQueueFamilyIndex, commandBuffer);
...@@ -140,7 +140,7 @@ angle::Result SemaphoreVk::wait(gl::Context *context, ...@@ -140,7 +140,7 @@ angle::Result SemaphoreVk::wait(gl::Context *context,
image.onExternalLayoutChange(layout); image.onExternalLayoutChange(layout);
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
// Queue ownership transfer. // Queue ownership transfer.
image.changeLayoutAndQueue(image.getAspectFlags(), layout, rendererQueueFamilyIndex, image.changeLayoutAndQueue(image.getAspectFlags(), layout, rendererQueueFamilyIndex,
...@@ -167,7 +167,7 @@ angle::Result SemaphoreVk::signal(gl::Context *context, ...@@ -167,7 +167,7 @@ angle::Result SemaphoreVk::signal(gl::Context *context,
vk::BufferHelper &bufferHelper = bufferVk->getBuffer(); vk::BufferHelper &bufferHelper = bufferVk->getBuffer();
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
// Queue ownership transfer. // Queue ownership transfer.
bufferHelper.changeQueue(VK_QUEUE_FAMILY_EXTERNAL, commandBuffer); bufferHelper.changeQueue(VK_QUEUE_FAMILY_EXTERNAL, commandBuffer);
...@@ -193,7 +193,7 @@ angle::Result SemaphoreVk::signal(gl::Context *context, ...@@ -193,7 +193,7 @@ angle::Result SemaphoreVk::signal(gl::Context *context,
} }
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
// Queue ownership transfer and layout transition. // Queue ownership transfer and layout transition.
image.changeLayoutAndQueue(image.getAspectFlags(), layout, VK_QUEUE_FAMILY_EXTERNAL, image.changeLayoutAndQueue(image.getAspectFlags(), layout, VK_QUEUE_FAMILY_EXTERNAL,
......
...@@ -1072,7 +1072,7 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk, ...@@ -1072,7 +1072,7 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk,
SwapchainImage &image = mSwapchainImages[mCurrentSwapchainImageIndex]; SwapchainImage &image = mSwapchainImages[mCurrentSwapchainImageIndex];
vk::CommandBuffer *commandBuffer = nullptr; vk::CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
if (mColorImageMS.valid()) if (mColorImageMS.valid())
{ {
...@@ -1081,7 +1081,7 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk, ...@@ -1081,7 +1081,7 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk,
&mColorImageMS)); &mColorImageMS));
ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst, ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst,
&image.image)); &image.image));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkImageResolve resolveRegion = {}; VkImageResolve resolveRegion = {};
resolveRegion.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; resolveRegion.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
......
...@@ -53,7 +53,7 @@ angle::Result SyncHelper::initialize(ContextVk *contextVk) ...@@ -53,7 +53,7 @@ angle::Result SyncHelper::initialize(ContextVk *contextVk)
mEvent = event.release(); mEvent = event.release();
vk::PrimaryCommandBuffer *primary; vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(contextVk->getPrimaryCommandBuffer(&primary)); ANGLE_TRY(contextVk->flushAndGetPrimaryCommandBuffer(&primary));
primary->setEvent(mEvent.getHandle(), VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT); primary->setEvent(mEvent.getHandle(), VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT);
contextVk->getResourceUseList().add(mUse); contextVk->getResourceUseList().add(mUse);
...@@ -107,7 +107,7 @@ angle::Result SyncHelper::clientWait(Context *context, ...@@ -107,7 +107,7 @@ angle::Result SyncHelper::clientWait(Context *context,
angle::Result SyncHelper::serverWait(ContextVk *contextVk) angle::Result SyncHelper::serverWait(ContextVk *contextVk)
{ {
vk::PrimaryCommandBuffer *primary; vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(contextVk->getPrimaryCommandBuffer(&primary)); ANGLE_TRY(contextVk->flushAndGetPrimaryCommandBuffer(&primary));
primary->waitEvents(1, mEvent.ptr(), VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, primary->waitEvents(1, mEvent.ptr(), VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, nullptr, 0, nullptr, 0, nullptr); VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, nullptr, 0, nullptr, 0, nullptr);
contextVk->getResourceUseList().add(mUse); contextVk->getResourceUseList().add(mUse);
......
...@@ -591,7 +591,7 @@ angle::Result TextureVk::copySubImageImplWithTransfer(ContextVk *contextVk, ...@@ -591,7 +591,7 @@ angle::Result TextureVk::copySubImageImplWithTransfer(ContextVk *contextVk,
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst, ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst,
mImage)); mImage));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkImageSubresourceLayers destSubresource = srcSubresource; VkImageSubresourceLayers destSubresource = srcSubresource;
destSubresource.mipLevel = level; destSubresource.mipLevel = level;
...@@ -621,7 +621,7 @@ angle::Result TextureVk::copySubImageImplWithTransfer(ContextVk *contextVk, ...@@ -621,7 +621,7 @@ angle::Result TextureVk::copySubImageImplWithTransfer(ContextVk *contextVk,
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst, ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst,
stagingImage.get())); stagingImage.get()));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkImageSubresourceLayers destSubresource = srcSubresource; VkImageSubresourceLayers destSubresource = srcSubresource;
destSubresource.mipLevel = 0; destSubresource.mipLevel = 0;
...@@ -822,7 +822,7 @@ angle::Result TextureVk::setEGLImageTarget(const gl::Context *context, ...@@ -822,7 +822,7 @@ angle::Result TextureVk::setEGLImageTarget(const gl::Context *context,
if (mImage->isQueueChangeNeccesary(rendererQueueFamilyIndex)) if (mImage->isQueueChangeNeccesary(rendererQueueFamilyIndex))
{ {
vk::CommandBuffer *commandBuffer = nullptr; vk::CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
mImage->changeLayoutAndQueue(VK_IMAGE_ASPECT_COLOR_BIT, mImage->changeLayoutAndQueue(VK_IMAGE_ASPECT_COLOR_BIT,
vk::ImageLayout::AllGraphicsShadersReadOnly, vk::ImageLayout::AllGraphicsShadersReadOnly,
rendererQueueFamilyIndex, commandBuffer); rendererQueueFamilyIndex, commandBuffer);
...@@ -1034,7 +1034,7 @@ angle::Result TextureVk::copyBufferDataToImage(ContextVk *contextVk, ...@@ -1034,7 +1034,7 @@ angle::Result TextureVk::copyBufferDataToImage(ContextVk *contextVk,
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_TRANSFER_READ_BIT, srcBuffer)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_TRANSFER_READ_BIT, srcBuffer));
ANGLE_TRY( ANGLE_TRY(
contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst, mImage)); contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst, mImage));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkBufferImageCopy region = {}; VkBufferImageCopy region = {};
region.bufferOffset = offset; region.bufferOffset = offset;
...@@ -1094,7 +1094,7 @@ angle::Result TextureVk::generateMipmapsWithCPU(const gl::Context *context) ...@@ -1094,7 +1094,7 @@ angle::Result TextureVk::generateMipmapsWithCPU(const gl::Context *context)
} }
vk::CommandBuffer *commandBuffer = nullptr; vk::CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
return mImage->flushStagedUpdates(contextVk, getNativeImageLevel(0), mImage->getLevelCount(), return mImage->flushStagedUpdates(contextVk, getNativeImageLevel(0), mImage->getLevelCount(),
getNativeImageLayer(0), mImage->getLayerCount(), getNativeImageLayer(0), mImage->getLayerCount(),
commandBuffer); commandBuffer);
...@@ -1139,7 +1139,7 @@ angle::Result TextureVk::generateMipmap(const gl::Context *context) ...@@ -1139,7 +1139,7 @@ angle::Result TextureVk::generateMipmap(const gl::Context *context)
{ {
vk::CommandBuffer *commandBuffer = nullptr; vk::CommandBuffer *commandBuffer = nullptr;
mImage->retain(&contextVk->getResourceUseList()); mImage->retain(&contextVk->getResourceUseList());
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
ANGLE_TRY(mImage->flushStagedUpdates(contextVk, getNativeImageLevel(0), ANGLE_TRY(mImage->flushStagedUpdates(contextVk, getNativeImageLevel(0),
mImage->getLevelCount(), getNativeImageLayer(0), mImage->getLevelCount(), getNativeImageLayer(0),
mImage->getLayerCount(), commandBuffer)); mImage->getLayerCount(), commandBuffer));
...@@ -1261,7 +1261,7 @@ angle::Result TextureVk::changeLevels(ContextVk *contextVk, ...@@ -1261,7 +1261,7 @@ angle::Result TextureVk::changeLevels(ContextVk *contextVk,
if (mImage->valid() && mImage->hasStagedUpdates()) if (mImage->valid() && mImage->hasStagedUpdates())
{ {
vk::CommandBuffer *commandBuffer = nullptr; vk::CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
ANGLE_TRY(mImage->flushStagedUpdates(contextVk, getNativeImageLevel(0), ANGLE_TRY(mImage->flushStagedUpdates(contextVk, getNativeImageLevel(0),
mImage->getLevelCount(), getNativeImageLayer(0), mImage->getLevelCount(), getNativeImageLayer(0),
mImage->getLayerCount(), commandBuffer)); mImage->getLayerCount(), commandBuffer));
...@@ -1401,7 +1401,7 @@ angle::Result TextureVk::ensureImageInitializedImpl(ContextVk *contextVk, ...@@ -1401,7 +1401,7 @@ angle::Result TextureVk::ensureImageInitializedImpl(ContextVk *contextVk,
} }
vk::CommandBuffer *commandBuffer = nullptr; vk::CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
return mImage->flushStagedUpdates(contextVk, getNativeImageLevel(0), mImage->getLevelCount(), return mImage->flushStagedUpdates(contextVk, getNativeImageLevel(0), mImage->getLevelCount(),
getNativeImageLayer(0), mImage->getLayerCount(), getNativeImageLayer(0), mImage->getLayerCount(),
commandBuffer); commandBuffer);
......
...@@ -779,7 +779,7 @@ angle::Result UtilsVk::clearBuffer(ContextVk *contextVk, ...@@ -779,7 +779,7 @@ angle::Result UtilsVk::clearBuffer(ContextVk *contextVk,
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
// Tell the context dest that we are writing to dest. // Tell the context dest that we are writing to dest.
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dest)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dest));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
const vk::Format &destFormat = dest->getViewFormat(); const vk::Format &destFormat = dest->getViewFormat();
...@@ -830,7 +830,7 @@ angle::Result UtilsVk::convertIndexBuffer(ContextVk *contextVk, ...@@ -830,7 +830,7 @@ angle::Result UtilsVk::convertIndexBuffer(ContextVk *contextVk,
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, src)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, src));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dest)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dest));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkDescriptorSet descriptorSet; VkDescriptorSet descriptorSet;
vk::RefCountedDescriptorPoolBinding descriptorPoolBinding; vk::RefCountedDescriptorPoolBinding descriptorPoolBinding;
...@@ -894,7 +894,7 @@ angle::Result UtilsVk::convertIndexIndirectBuffer(ContextVk *contextVk, ...@@ -894,7 +894,7 @@ angle::Result UtilsVk::convertIndexIndirectBuffer(ContextVk *contextVk,
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, srcIndexBuf)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, srcIndexBuf));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dstIndirectBuf)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dstIndirectBuf));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dstIndexBuf)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dstIndexBuf));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkDescriptorSet descriptorSet; VkDescriptorSet descriptorSet;
vk::RefCountedDescriptorPoolBinding descriptorPoolBinding; vk::RefCountedDescriptorPoolBinding descriptorPoolBinding;
...@@ -962,7 +962,7 @@ angle::Result UtilsVk::convertLineLoopIndexIndirectBuffer( ...@@ -962,7 +962,7 @@ angle::Result UtilsVk::convertLineLoopIndexIndirectBuffer(
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, srcIndexBuffer)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, srcIndexBuffer));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dstIndirectBuffer)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dstIndirectBuffer));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dstIndexBuffer)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dstIndexBuffer));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkDescriptorSet descriptorSet; VkDescriptorSet descriptorSet;
vk::RefCountedDescriptorPoolBinding descriptorPoolBinding; vk::RefCountedDescriptorPoolBinding descriptorPoolBinding;
...@@ -1025,7 +1025,7 @@ angle::Result UtilsVk::convertLineLoopArrayIndirectBuffer( ...@@ -1025,7 +1025,7 @@ angle::Result UtilsVk::convertLineLoopArrayIndirectBuffer(
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, srcIndirectBuffer)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, srcIndirectBuffer));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, destIndirectBuffer)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, destIndirectBuffer));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, destIndexBuffer)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, destIndexBuffer));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkDescriptorSet descriptorSet; VkDescriptorSet descriptorSet;
vk::RefCountedDescriptorPoolBinding descriptorPoolBinding; vk::RefCountedDescriptorPoolBinding descriptorPoolBinding;
...@@ -1080,7 +1080,7 @@ angle::Result UtilsVk::convertVertexBuffer(ContextVk *contextVk, ...@@ -1080,7 +1080,7 @@ angle::Result UtilsVk::convertVertexBuffer(ContextVk *contextVk,
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, src)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, src));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dest)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_SHADER_WRITE_BIT, dest));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
ConvertVertexShaderParams shaderParams; ConvertVertexShaderParams shaderParams;
shaderParams.Ns = params.srcFormat->channelCount; shaderParams.Ns = params.srcFormat->channelCount;
...@@ -1173,8 +1173,9 @@ angle::Result UtilsVk::startRenderPass(ContextVk *contextVk, ...@@ -1173,8 +1173,9 @@ angle::Result UtilsVk::startRenderPass(ContextVk *contextVk,
renderPassAttachmentOps.initWithLoadStore(0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, renderPassAttachmentOps.initWithLoadStore(0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
ANGLE_TRY(contextVk->beginRenderPass(framebuffer, renderArea, renderPassDesc, ANGLE_TRY(contextVk->flushAndBeginRenderPass(framebuffer, renderArea, renderPassDesc,
renderPassAttachmentOps, clearValues, commandBufferOut)); renderPassAttachmentOps, clearValues,
commandBufferOut));
contextVk->addGarbage(&framebuffer); contextVk->addGarbage(&framebuffer);
...@@ -1555,7 +1556,7 @@ angle::Result UtilsVk::stencilBlitResolveNoShaderExport(ContextVk *contextVk, ...@@ -1555,7 +1556,7 @@ angle::Result UtilsVk::stencilBlitResolveNoShaderExport(ContextVk *contextVk,
contextVk->onImageRead(src->getAspectFlags(), vk::ImageLayout::ComputeShaderReadOnly, src)); contextVk->onImageRead(src->getAspectFlags(), vk::ImageLayout::ComputeShaderReadOnly, src));
ANGLE_TRY(contextVk->onImageWrite(depthStencilImage->getAspectFlags(), ANGLE_TRY(contextVk->onImageWrite(depthStencilImage->getAspectFlags(),
vk::ImageLayout::TransferDst, depthStencilImage)); vk::ImageLayout::TransferDst, depthStencilImage));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
// Blit/resolve stencil into the buffer. // Blit/resolve stencil into the buffer.
VkDescriptorImageInfo imageInfo = {}; VkDescriptorImageInfo imageInfo = {};
...@@ -1786,7 +1787,7 @@ angle::Result UtilsVk::cullOverlayWidgets(ContextVk *contextVk, ...@@ -1786,7 +1787,7 @@ angle::Result UtilsVk::cullOverlayWidgets(ContextVk *contextVk,
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, enabledWidgetsBuffer)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, enabledWidgetsBuffer));
ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT,
vk::ImageLayout::ComputeShaderWrite, dest)); vk::ImageLayout::ComputeShaderWrite, dest));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkDescriptorImageInfo imageInfo = {}; VkDescriptorImageInfo imageInfo = {};
imageInfo.imageView = destView->getHandle(); imageInfo.imageView = destView->getHandle();
...@@ -1863,7 +1864,7 @@ angle::Result UtilsVk::drawOverlay(ContextVk *contextVk, ...@@ -1863,7 +1864,7 @@ angle::Result UtilsVk::drawOverlay(ContextVk *contextVk,
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, textWidgetsBuffer)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, textWidgetsBuffer));
ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, graphWidgetsBuffer)); ANGLE_TRY(contextVk->onBufferRead(VK_ACCESS_SHADER_READ_BIT, graphWidgetsBuffer));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkDescriptorImageInfo imageInfos[3] = {}; VkDescriptorImageInfo imageInfos[3] = {};
imageInfos[0].imageView = destView->getHandle(); imageInfos[0].imageView = destView->getHandle();
......
...@@ -1022,7 +1022,7 @@ void QueryHelper::deinit() ...@@ -1022,7 +1022,7 @@ void QueryHelper::deinit()
angle::Result QueryHelper::beginQuery(ContextVk *contextVk) angle::Result QueryHelper::beginQuery(ContextVk *contextVk)
{ {
vk::PrimaryCommandBuffer *primaryCommands; vk::PrimaryCommandBuffer *primaryCommands;
ANGLE_TRY(contextVk->getPrimaryCommandBuffer(&primaryCommands)); ANGLE_TRY(contextVk->flushAndGetPrimaryCommandBuffer(&primaryCommands));
VkQueryPool queryPool = getQueryPool()->getHandle(); VkQueryPool queryPool = getQueryPool()->getHandle();
primaryCommands->resetQueryPool(queryPool, mQuery, 1); primaryCommands->resetQueryPool(queryPool, mQuery, 1);
primaryCommands->beginQuery(queryPool, mQuery, 0); primaryCommands->beginQuery(queryPool, mQuery, 0);
...@@ -1033,7 +1033,7 @@ angle::Result QueryHelper::beginQuery(ContextVk *contextVk) ...@@ -1033,7 +1033,7 @@ angle::Result QueryHelper::beginQuery(ContextVk *contextVk)
angle::Result QueryHelper::endQuery(ContextVk *contextVk) angle::Result QueryHelper::endQuery(ContextVk *contextVk)
{ {
vk::PrimaryCommandBuffer *primaryCommands; vk::PrimaryCommandBuffer *primaryCommands;
ANGLE_TRY(contextVk->getPrimaryCommandBuffer(&primaryCommands)); ANGLE_TRY(contextVk->flushAndGetPrimaryCommandBuffer(&primaryCommands));
VkQueryPool queryPool = getQueryPool()->getHandle(); VkQueryPool queryPool = getQueryPool()->getHandle();
primaryCommands->endQuery(queryPool, mQuery); primaryCommands->endQuery(queryPool, mQuery);
mMostRecentSerial = contextVk->getCurrentQueueSerial(); mMostRecentSerial = contextVk->getCurrentQueueSerial();
...@@ -1043,7 +1043,7 @@ angle::Result QueryHelper::endQuery(ContextVk *contextVk) ...@@ -1043,7 +1043,7 @@ angle::Result QueryHelper::endQuery(ContextVk *contextVk)
angle::Result QueryHelper::writeTimestamp(ContextVk *contextVk) angle::Result QueryHelper::writeTimestamp(ContextVk *contextVk)
{ {
vk::PrimaryCommandBuffer *primaryCommands; vk::PrimaryCommandBuffer *primaryCommands;
ANGLE_TRY(contextVk->getPrimaryCommandBuffer(&primaryCommands)); ANGLE_TRY(contextVk->flushAndGetPrimaryCommandBuffer(&primaryCommands));
VkQueryPool queryPool = getQueryPool()->getHandle(); VkQueryPool queryPool = getQueryPool()->getHandle();
primaryCommands->resetQueryPool(queryPool, mQuery, 1); primaryCommands->resetQueryPool(queryPool, mQuery, 1);
primaryCommands->writeTimestamp(VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, queryPool, mQuery); primaryCommands->writeTimestamp(VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, queryPool, mQuery);
...@@ -1572,7 +1572,7 @@ angle::Result BufferHelper::copyFromBuffer(ContextVk *contextVk, ...@@ -1572,7 +1572,7 @@ angle::Result BufferHelper::copyFromBuffer(ContextVk *contextVk,
{ {
// 'recordCommands' will implicitly stop any reads from using the old buffer data. // 'recordCommands' will implicitly stop any reads from using the old buffer data.
CommandBuffer *commandBuffer = nullptr; CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
if (mCurrentReadAccess != 0 || mCurrentWriteAccess != 0 || bufferAccessType != 0) if (mCurrentReadAccess != 0 || mCurrentWriteAccess != 0 || bufferAccessType != 0)
{ {
...@@ -2303,7 +2303,7 @@ angle::Result ImageHelper::generateMipmapsWithBlit(ContextVk *contextVk, GLuint ...@@ -2303,7 +2303,7 @@ angle::Result ImageHelper::generateMipmapsWithBlit(ContextVk *contextVk, GLuint
{ {
CommandBuffer *commandBuffer = nullptr; CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, ImageLayout::TransferDst, this)); ANGLE_TRY(contextVk->onImageWrite(VK_IMAGE_ASPECT_COLOR_BIT, ImageLayout::TransferDst, this));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
// We are able to use blitImage since the image format we are using supports it. This // We are able to use blitImage since the image format we are using supports it. This
// is a faster way we can generate the mips. // is a faster way we can generate the mips.
...@@ -3091,7 +3091,7 @@ angle::Result ImageHelper::flushAllStagedUpdates(ContextVk *contextVk) ...@@ -3091,7 +3091,7 @@ angle::Result ImageHelper::flushAllStagedUpdates(ContextVk *contextVk)
{ {
// Clear the image. // Clear the image.
CommandBuffer *commandBuffer = nullptr; CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
return flushStagedUpdates(contextVk, 0, mLevelCount, 0, mLayerCount, commandBuffer); return flushStagedUpdates(contextVk, 0, mLevelCount, 0, mLayerCount, commandBuffer);
} }
...@@ -3177,7 +3177,7 @@ angle::Result ImageHelper::copyImageDataToBuffer(ContextVk *contextVk, ...@@ -3177,7 +3177,7 @@ angle::Result ImageHelper::copyImageDataToBuffer(ContextVk *contextVk,
CommandBuffer *commandBuffer = nullptr; CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(contextVk->onImageRead(aspectFlags, ImageLayout::TransferSrc, this)); ANGLE_TRY(contextVk->onImageRead(aspectFlags, ImageLayout::TransferSrc, this));
ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_TRANSFER_WRITE_BIT, *bufferOut)); ANGLE_TRY(contextVk->onBufferWrite(VK_ACCESS_TRANSFER_WRITE_BIT, *bufferOut));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
VkBufferImageCopy regions[2] = {}; VkBufferImageCopy regions[2] = {};
// Default to non-combined DS case // Default to non-combined DS case
...@@ -3339,7 +3339,7 @@ angle::Result ImageHelper::readPixels(ContextVk *contextVk, ...@@ -3339,7 +3339,7 @@ angle::Result ImageHelper::readPixels(ContextVk *contextVk,
&resolvedImage.get())); &resolvedImage.get()));
} }
ANGLE_TRY(contextVk->onImageRead(copyAspectFlags, ImageLayout::TransferSrc, this)); ANGLE_TRY(contextVk->onImageRead(copyAspectFlags, ImageLayout::TransferSrc, this));
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(&commandBuffer)); ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer));
const angle::Format *readFormat = &mFormat->actualImageFormat(); const angle::Format *readFormat = &mFormat->actualImageFormat();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment