Commit 81432c24 by Charlie Lao Committed by Commit Bot

Vulkan: Rename onImageHelperRelease to finalizeImageLayout

Make the API name reflect what it does. With recent changes, this get called from places that are not releasing ImageHelper object, but is try to reference the current layout. This new name makes more sense than onImageHelperRelease (at that time when this API was introduced, it was only called when ImageHelper is being released). Bug: b/175584609 Change-Id: Ie5f5fcdbd97436724d7eb016374d8b4178e7ba1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2776261 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent 02acc5ee
...@@ -497,11 +497,11 @@ class ContextVk : public ContextImpl, public vk::Context, public MultisampleText ...@@ -497,11 +497,11 @@ class ContextVk : public ContextImpl, public vk::Context, public MultisampleText
layerCount, image, resolveImage); layerCount, image, resolveImage);
} }
void onImageHelperRelease(const vk::ImageHelper *image) void finalizeImageLayout(const vk::ImageHelper *image)
{ {
if (mRenderPassCommands->started()) if (mRenderPassCommands->started())
{ {
mRenderPassCommands->onImageHelperRelease(this, image); mRenderPassCommands->finalizeImageLayout(this, image);
} }
} }
......
...@@ -1329,7 +1329,7 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk, ...@@ -1329,7 +1329,7 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk,
// Because the color attachment defers layout changes until endRenderPass time, we must call // Because the color attachment defers layout changes until endRenderPass time, we must call
// finalize the layout transition in the renderpass before we insert layout change to // finalize the layout transition in the renderpass before we insert layout change to
// ImageLayout::Present bellow. // ImageLayout::Present bellow.
contextVk->onImageHelperRelease(&image.image); contextVk->finalizeImageLayout(&image.image);
vk::CommandBuffer *commandBuffer; vk::CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer({}, &commandBuffer)); ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer({}, &commandBuffer));
......
...@@ -1358,7 +1358,7 @@ void CommandBufferHelper::finalizeDepthStencilResolveImageLayout(Context *contex ...@@ -1358,7 +1358,7 @@ void CommandBufferHelper::finalizeDepthStencilResolveImageLayout(Context *contex
} }
} }
void CommandBufferHelper::onImageHelperRelease(Context *context, const ImageHelper *image) void CommandBufferHelper::finalizeImageLayout(Context *context, const ImageHelper *image)
{ {
ASSERT(mIsRenderPassCommandBuffer); ASSERT(mIsRenderPassCommandBuffer);
...@@ -3909,7 +3909,7 @@ void ImageHelper::releaseImageFromShareContexts(RendererVk *renderer, ContextVk ...@@ -3909,7 +3909,7 @@ void ImageHelper::releaseImageFromShareContexts(RendererVk *renderer, ContextVk
ShareContextSet &shareContextSet = *contextVk->getShareGroupVk()->getShareContextSet(); ShareContextSet &shareContextSet = *contextVk->getShareGroupVk()->getShareContextSet();
for (ContextVk *ctx : shareContextSet) for (ContextVk *ctx : shareContextSet)
{ {
ctx->onImageHelperRelease(this); ctx->finalizeImageLayout(this);
} }
} }
...@@ -5754,7 +5754,7 @@ void ImageHelper::stageSelfForBaseLevel(ContextVk *contextVk) ...@@ -5754,7 +5754,7 @@ void ImageHelper::stageSelfForBaseLevel(ContextVk *contextVk)
// Because we are cloning this object to another object, we must finalize the layout if it is // Because we are cloning this object to another object, we must finalize the layout if it is
// being used by current renderpass as attachment. Otherwise we are copying the incorrect layout // being used by current renderpass as attachment. Otherwise we are copying the incorrect layout
// since it is determined at endRenderPass time. // since it is determined at endRenderPass time.
contextVk->onImageHelperRelease(this); contextVk->finalizeImageLayout(this);
std::unique_ptr<ImageHelper> prevImage = std::make_unique<ImageHelper>(); std::unique_ptr<ImageHelper> prevImage = std::make_unique<ImageHelper>();
// Move the necessary information for staged update to work, and keep the rest as part of this // Move the necessary information for staged update to work, and keep the rest as part of this
......
...@@ -1086,7 +1086,8 @@ class CommandBufferHelper : angle::NonCopyable ...@@ -1086,7 +1086,8 @@ class CommandBufferHelper : angle::NonCopyable
return mRenderPassStarted; return mRenderPassStarted;
} }
void onImageHelperRelease(Context *context, const ImageHelper *image); // Finalize the layout if image has any deferred layout transition.
void finalizeImageLayout(Context *context, const ImageHelper *image);
void beginRenderPass(const Framebuffer &framebuffer, void beginRenderPass(const Framebuffer &framebuffer,
const gl::Rectangle &renderArea, const gl::Rectangle &renderArea,
......
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