mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-06-03 05:05:00 -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();
|
HRTick currentTick = HighResolutionTimer().now().getTick();
|
||||||
// create info entry and store in ordered linked list
|
// create info entry and store in ordered linked list
|
||||||
LatteTextureReadbackInfo* readbackInfo = g_renderer->texture_createReadback(textureView);
|
LatteTextureReadbackInfo* readbackInfo = g_renderer->texture_createReadback(textureView);
|
||||||
|
if (!readbackInfo)
|
||||||
|
return;
|
||||||
sTextureActiveReadbackQueue.push(readbackInfo);
|
sTextureActiveReadbackQueue.push(readbackInfo);
|
||||||
readbackInfo->StartTransfer();
|
readbackInfo->StartTransfer();
|
||||||
readbackInfo->transferStartTime = currentTick;
|
readbackInfo->transferStartTime = currentTick;
|
||||||
|
|||||||
@ -3670,14 +3670,14 @@ void VulkanRenderer::texture_copyImageSubData(LatteTexture* src, sint32 srcMip,
|
|||||||
LatteTextureReadbackInfo* VulkanRenderer::texture_createReadback(LatteTextureView* textureView)
|
LatteTextureReadbackInfo* VulkanRenderer::texture_createReadback(LatteTextureView* textureView)
|
||||||
{
|
{
|
||||||
auto* result = new LatteTextureReadbackInfoVk(m_logicalDevice, 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 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
|
const uint32 uploadAlignment = 256; // todo - use Vk optimalBufferCopyOffsetAlignment
|
||||||
m_textureReadbackBufferWriteIndex = (m_textureReadbackBufferWriteIndex + uploadAlignment - 1) & ~(uploadAlignment - 1);
|
m_textureReadbackBufferWriteIndex = (m_textureReadbackBufferWriteIndex + uploadAlignment - 1) & ~(uploadAlignment - 1);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user