-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readback Vulkan fixes #1430
Readback Vulkan fixes #1430
Changes from 2 commits
952fd0d
31c6ddd
90480ed
c8cc31e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ uint32 LatteTextureReadbackInfoVk::GetImageSize(LatteTextureView* textureView) | |
cemu_assert(textureFormat == VK_FORMAT_R8G8B8A8_UNORM); | ||
return baseTexture->width * baseTexture->height * 4; | ||
} | ||
else if (textureView->format == Latte::E_GX2SURFFMT::R8_UNORM) | ||
else if (textureView->format == Latte::E_GX2SURFFMT::R8_UNORM ) | ||
{ | ||
cemu_assert(textureFormat == VK_FORMAT_R8_UNORM); | ||
return baseTexture->width * baseTexture->height * 1; | ||
|
@@ -79,6 +79,16 @@ uint32 LatteTextureReadbackInfoVk::GetImageSize(LatteTextureView* textureView) | |
// todo - if driver does not support VK_FORMAT_D24_UNORM_S8_UINT this is represented as VK_FORMAT_D32_SFLOAT_S8_UINT which is 8 bytes | ||
return baseTexture->width * baseTexture->height * 4; | ||
} | ||
else if (textureView->format == Latte::E_GX2SURFFMT::R5_G6_B5_UNORM ) | ||
{ | ||
cemu_assert(textureFormat == VK_FORMAT_R8G8B8A8_UNORM); | ||
return baseTexture->width * baseTexture->height * 4; | ||
rcaridade145 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
else if (textureView->format == Latte::E_GX2SURFFMT::R5_G5_B5_A1_UNORM ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed |
||
{ | ||
cemu_assert(textureFormat == VK_FORMAT_R8G8B8A8_UNORM); | ||
return baseTexture->width * baseTexture->height * 4; | ||
} | ||
else | ||
{ | ||
cemuLog_log(LogType::Force, "Unsupported texture readback format {:04x}", (uint32)textureView->format); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latte::E_GX2SURFFMT::R5_G6_B5_UNORM
is a bit tricky, because it can be emulated as eitherVK_FORMAT_R5G6B5_UNORM_PACK16
or if that is not supported by the driver the Vulkan backend will fallback toVK_FORMAT_R8G8B8A8_UNORM
. See the code here. The readback code needs to handle this correctly. For non-matching formats conversion is necessary. If you want to keep it simple you could ignore the more complicated case and return 0 whentextureFormat != VK_FORMAT_R5G6B5_UNORM_PACK16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully things are ok now.