Commit 7d45184d by Jamie Madill Committed by Commit Bot

Vulkan: Fix naming in CommandGraphResource.

Accidentally submitted a patch set without requested changes. This corrects the function names to 'hasRecordedCommands' and 'hasRunningCommands'. Bug: angleproject:4029 Change-Id: I1cf3046052ace304594ef939566b0b36bae822df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2013924Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent f6506799
...@@ -271,15 +271,15 @@ angle::Result BufferVk::mapRangeImpl(ContextVk *contextVk, ...@@ -271,15 +271,15 @@ angle::Result BufferVk::mapRangeImpl(ContextVk *contextVk,
if ((access & GL_MAP_UNSYNCHRONIZED_BIT) == 0) if ((access & GL_MAP_UNSYNCHRONIZED_BIT) == 0)
{ {
// If there are pending commands for the buffer, flush them. // If there are pending commands for the buffer, flush them.
if (mBuffer.isInUseByANGLE()) if (mBuffer.hasRecordedCommands())
{ {
ANGLE_TRY(contextVk->flushImpl(nullptr)); ANGLE_TRY(contextVk->flushImpl(nullptr));
} }
// Make sure the driver is done with the buffer. // Make sure the driver is done with the buffer.
if (mBuffer.isInUseByDriver(contextVk->getLastCompletedQueueSerial())) if (mBuffer.hasRunningCommands(contextVk->getLastCompletedQueueSerial()))
{ {
ANGLE_TRY(mBuffer.finishDriverUse(contextVk)); ANGLE_TRY(mBuffer.finishRunningCommands(contextVk));
} }
ASSERT(!mBuffer.isCurrentlyInUse(contextVk->getLastCompletedQueueSerial())); ASSERT(!mBuffer.isCurrentlyInUse(contextVk->getLastCompletedQueueSerial()));
...@@ -332,7 +332,7 @@ angle::Result BufferVk::getIndexRange(const gl::Context *context, ...@@ -332,7 +332,7 @@ angle::Result BufferVk::getIndexRange(const gl::Context *context,
ANGLE_TRACE_EVENT0("gpu.angle", "BufferVk::getIndexRange"); ANGLE_TRACE_EVENT0("gpu.angle", "BufferVk::getIndexRange");
// Needed before reading buffer or we could get stale data. // Needed before reading buffer or we could get stale data.
ANGLE_TRY(mBuffer.finishDriverUse(contextVk)); ANGLE_TRY(mBuffer.finishRunningCommands(contextVk));
// TODO(jmadill): Consider keeping a shadow system memory copy in some cases. // TODO(jmadill): Consider keeping a shadow system memory copy in some cases.
ASSERT(mBuffer.valid()); ASSERT(mBuffer.valid());
......
...@@ -297,7 +297,7 @@ CommandGraphResource::~CommandGraphResource() ...@@ -297,7 +297,7 @@ CommandGraphResource::~CommandGraphResource()
mUse.release(); mUse.release();
} }
angle::Result CommandGraphResource::finishDriverUse(ContextVk *contextVk) angle::Result CommandGraphResource::finishRunningCommands(ContextVk *contextVk)
{ {
return contextVk->finishToSerial(mUse.getSerial()); return contextVk->finishToSerial(mUse.getSerial());
} }
......
...@@ -438,10 +438,10 @@ class CommandGraphResource : angle::NonCopyable ...@@ -438,10 +438,10 @@ class CommandGraphResource : angle::NonCopyable
// Returns true if the resource has commands in the graph. This is used to know if a flush // Returns true if the resource has commands in the graph. This is used to know if a flush
// should be performed, e.g. if we need to wait for the GPU to finish with the resource. // should be performed, e.g. if we need to wait for the GPU to finish with the resource.
bool isInUseByANGLE() const { return mUse.hasRecordedCommands(); } bool hasRecordedCommands() const { return mUse.hasRecordedCommands(); }
// Determine if the driver has finished execution with this resource. // Determine if the driver has finished execution with this resource.
bool isInUseByDriver(Serial lastCompletedSerial) const bool hasRunningCommands(Serial lastCompletedSerial) const
{ {
return mUse.hasRunningCommands(lastCompletedSerial); return mUse.hasRunningCommands(lastCompletedSerial);
} }
...@@ -453,7 +453,7 @@ class CommandGraphResource : angle::NonCopyable ...@@ -453,7 +453,7 @@ class CommandGraphResource : angle::NonCopyable
} }
// Ensures the driver is caught up to this resource and it is only in use by ANGLE. // Ensures the driver is caught up to this resource and it is only in use by ANGLE.
angle::Result finishDriverUse(ContextVk *contextVk); angle::Result finishRunningCommands(ContextVk *contextVk);
// Sets up dependency relations. 'this' resource is the resource being written to. // Sets up dependency relations. 'this' resource is the resource being written to.
void addWriteDependency(ContextVk *contextVk, CommandGraphResource *writingResource); void addWriteDependency(ContextVk *contextVk, CommandGraphResource *writingResource);
......
...@@ -100,7 +100,7 @@ angle::Result SemaphoreVk::wait(gl::Context *context, ...@@ -100,7 +100,7 @@ angle::Result SemaphoreVk::wait(gl::Context *context,
// If there were GL commands using this buffer prior to this call, that's a // If there were GL commands using this buffer prior to this call, that's a
// synchronization error on behalf of the program. // synchronization error on behalf of the program.
ASSERT(!bufferHelper.isInUseByANGLE()); ASSERT(!bufferHelper.hasRecordedCommands());
vk::CommandBuffer *queueChange; vk::CommandBuffer *queueChange;
ANGLE_TRY(bufferHelper.recordCommands(contextVk, &queueChange)); ANGLE_TRY(bufferHelper.recordCommands(contextVk, &queueChange));
...@@ -123,7 +123,7 @@ angle::Result SemaphoreVk::wait(gl::Context *context, ...@@ -123,7 +123,7 @@ angle::Result SemaphoreVk::wait(gl::Context *context,
// If there were GL commands using this image prior to this call, that's a // If there were GL commands using this image prior to this call, that's a
// synchronization error on behalf of the program. // synchronization error on behalf of the program.
ASSERT(!image.isInUseByANGLE()); ASSERT(!image.hasRecordedCommands());
// Inform the image that the layout has been externally changed. // Inform the image that the layout has been externally changed.
image.onExternalLayoutChange(layout); image.onExternalLayoutChange(layout);
......
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