mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-06-02 12:45:01 -06:00
Vulkan: Skip zero-size readback buffer barriers (#1929)
This commit is contained in:
parent
ca15637b63
commit
a02ba9d82b
@ -21,6 +21,8 @@ void LatteTextureReadback_StartTransfer(LatteTextureView* textureView)
|
||||
HRTick currentTick = HighResolutionTimer().now().getTick();
|
||||
// create info entry and store in ordered linked list
|
||||
LatteTextureReadbackInfo* readbackInfo = g_renderer->texture_createReadback(textureView);
|
||||
if (!readbackInfo)
|
||||
return;
|
||||
sTextureActiveReadbackQueue.push(readbackInfo);
|
||||
readbackInfo->StartTransfer();
|
||||
readbackInfo->transferStartTime = currentTick;
|
||||
|
||||
@ -3670,14 +3670,14 @@ void VulkanRenderer::texture_copyImageSubData(LatteTexture* src, sint32 srcMip,
|
||||
LatteTextureReadbackInfo* VulkanRenderer::texture_createReadback(LatteTextureView* textureView)
|
||||
{
|
||||
auto* result = new LatteTextureReadbackInfoVk(m_logicalDevice, textureView);
|
||||
|
||||
LatteTextureVk* vkTex = (LatteTextureVk*)textureView->baseTexture;
|
||||
|
||||
VkMemoryRequirements memRequirements;
|
||||
vkGetImageMemoryRequirements(m_logicalDevice, vkTex->GetImageObj()->m_image, &memRequirements);
|
||||
|
||||
const uint32 linearImageSize = result->GetImageSize();
|
||||
const uint32 uploadSize = (linearImageSize == 0) ? memRequirements.size : linearImageSize;
|
||||
if (linearImageSize == 0)
|
||||
{
|
||||
delete result;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const uint32 uploadSize = linearImageSize;
|
||||
const uint32 uploadAlignment = 256; // todo - use Vk optimalBufferCopyOffsetAlignment
|
||||
m_textureReadbackBufferWriteIndex = (m_textureReadbackBufferWriteIndex + uploadAlignment - 1) & ~(uploadAlignment - 1);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user