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