зеркало из https://github.com/AvaloniaUI/angle.git
Vulkan: Don't retain in buffer/imageRead unnecessarily
mUsedBuffers/images already tracks whether a buffer/image is used in a render pass, so we can add to ContextVk's resource use list only once. Bug: angleproject:6717 Change-Id: Idd528c7f0f3fcb4d8d8879ab6cc7055260ecb45d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3310523 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Родитель
2d41e0f742
Коммит
8815245a8c
|
@ -1104,7 +1104,6 @@ void CommandBufferHelper::bufferRead(ContextVk *contextVk,
|
|||
PipelineStage readStage,
|
||||
BufferHelper *buffer)
|
||||
{
|
||||
buffer->retainReadOnly(&contextVk->getResourceUseList());
|
||||
VkPipelineStageFlagBits stageBits = kPipelineStageFlagBitMap[readStage];
|
||||
if (buffer->recordReadBarrier(readAccessType, stageBits, &mPipelineBarriers[readStage]))
|
||||
{
|
||||
|
@ -1115,6 +1114,7 @@ void CommandBufferHelper::bufferRead(ContextVk *contextVk,
|
|||
if (!mUsedBuffers.contains(buffer->getBufferSerial().getValue()))
|
||||
{
|
||||
mUsedBuffers.insert(buffer->getBufferSerial().getValue(), BufferAccess::Read);
|
||||
buffer->retainReadOnly(&contextVk->getResourceUseList());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1155,8 +1155,6 @@ void CommandBufferHelper::imageRead(ContextVk *contextVk,
|
|||
ImageLayout imageLayout,
|
||||
ImageHelper *image)
|
||||
{
|
||||
image->retain(&contextVk->getResourceUseList());
|
||||
|
||||
if (image->isReadBarrierNecessary(imageLayout))
|
||||
{
|
||||
updateImageLayoutAndBarrier(contextVk, image, aspectFlags, imageLayout);
|
||||
|
@ -1169,8 +1167,13 @@ void CommandBufferHelper::imageRead(ContextVk *contextVk,
|
|||
if (!usesImageInRenderPass(*image))
|
||||
{
|
||||
mRenderPassUsedImages.insert(image->getImageSerial().getValue());
|
||||
image->retain(&contextVk->getResourceUseList());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
image->retain(&contextVk->getResourceUseList());
|
||||
}
|
||||
}
|
||||
|
||||
void CommandBufferHelper::imageWrite(ContextVk *contextVk,
|
||||
|
|
Загрузка…
Ссылка в новой задаче