Commit 78dcba58 by Jeff Vigil Committed by Commit Bot

Refactor SyncHelper with vk::Resource

Set SyncVk's SyncHelper to inherit from vk::Resource. Bug: angleproject:2517 Change-Id: I499414d97e611d029abc12622f19436cbdb3e1f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2160126 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 1fc354fa
...@@ -19,15 +19,9 @@ namespace rx ...@@ -19,15 +19,9 @@ namespace rx
{ {
namespace vk namespace vk
{ {
SyncHelper::SyncHelper() SyncHelper::SyncHelper() {}
{
mUse.init();
}
SyncHelper::~SyncHelper() SyncHelper::~SyncHelper() {}
{
mUse.release();
}
void SyncHelper::releaseToRenderer(RendererVk *renderer) void SyncHelper::releaseToRenderer(RendererVk *renderer)
{ {
...@@ -55,7 +49,7 @@ angle::Result SyncHelper::initialize(ContextVk *contextVk) ...@@ -55,7 +49,7 @@ angle::Result SyncHelper::initialize(ContextVk *contextVk)
vk::PrimaryCommandBuffer *primary; vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(contextVk->flushAndGetPrimaryCommandBuffer(&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); retain(&contextVk->getResourceUseList());
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -110,7 +104,7 @@ angle::Result SyncHelper::serverWait(ContextVk *contextVk) ...@@ -110,7 +104,7 @@ angle::Result SyncHelper::serverWait(ContextVk *contextVk)
ANGLE_TRY(contextVk->flushAndGetPrimaryCommandBuffer(&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); retain(&contextVk->getResourceUseList());
return angle::Result::Continue; return angle::Result::Continue;
} }
......
...@@ -25,7 +25,7 @@ namespace vk ...@@ -25,7 +25,7 @@ namespace vk
{ {
// The behaviors of SyncImpl and EGLSyncImpl as fence syncs (only supported type) are currently // The behaviors of SyncImpl and EGLSyncImpl as fence syncs (only supported type) are currently
// identical for the Vulkan backend, and this class implements both interfaces. // identical for the Vulkan backend, and this class implements both interfaces.
class SyncHelper class SyncHelper : public vk::Resource
{ {
public: public:
SyncHelper(); SyncHelper();
...@@ -49,8 +49,6 @@ class SyncHelper ...@@ -49,8 +49,6 @@ class SyncHelper
// The fence is signaled once the CB including the `init` signal is executed. // The fence is signaled once the CB including the `init` signal is executed.
// `clientWait` waits on this fence. // `clientWait` waits on this fence.
Shared<Fence> mFence; Shared<Fence> mFence;
SharedResourceUse mUse;
}; };
} // namespace vk } // namespace vk
......
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