Repository navigation
Make the Xenoblade Chronicles: Definitive Edition profile work on Android (1/3): raw uint views of packed formats, uncompressed - #640
Open
tapionallanaire wants to merge 1 commit into
Conversation
Xenoblade Chronicles: Definitive Edition reads its 1280x720 A2B10G10R10 targets as uint shader images (their raw 32-bit words). Packed 4-byte formats had no class twin, so those images read as unbound: black roads in Colony 9. class_twin now gives them R32_UINT / R32_SINT. With the view, Turnip on a7xx kept UBWC on the image (it treats all view formats as UBWC-compatible) and the R32_UINT view read compressed blocks: the roads came out in black and grey blocks. An image whose format list holds a view of another texel layout (not its sRGB / raw UNORM twin) is now made with VK_IMAGE_COMPRESSION_DISABLED_EXT where the device has VK_EXT_image_compression_control. DM_VK_UBWC_RAWVIEW=0 turns it off. Tested on an AYN Thor (Adreno 740, Turnip v27.0.0-R1): TU_DEBUG=noubwc drew the roads right; sysmem, nolrz, DM_VK_UBWC=0 and DM_VK_ZSHARE=0 did not. With the change the roads are right with no TU_DEBUG.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two changes to how the Vulkan replay views packed 4-byte formats:
class_twingives packed 4-byte formats (B10G11R11, E5B9G9R9, A2B10G10R10, BGRA8, sRGB RGBA8) R32_UINT / R32_SINT twins. A shader that reads them as uint / int images gets the texel's raw 32-bit word, as Maxwell's raw image load does.VK_IMAGE_COMPRESSION_DISABLED_EXT, where the device hasVK_EXT_image_compression_control.DM_VK_UBWC_RAWVIEW=0turns it off.Why
Xenoblade Chronicles: Definitive Edition reads its 1280x720 A2B10G10R10 targets (NVN format
0x3d) as uint shader images in four shaders (48b8ea8fad25398d,fe993ca274dfde1c,5119ea2c4c0a2211,efa9a20a7f820920). Without a twin, the images read as unbound ([RED] ... has no view of shape 0x81 (storage)), so the roads in Colony 9 drew black.With the view, the roads came out in black and grey blocks. Turnip on a7xx keeps UBWC on an image whatever its view formats (
ubwc_all_formats_compatible), so the R32_UINT view read compressed data.Tested
AYN Thor (Adreno 740, Turnip v27.0.0-R1), XCDE 1.1.2, Colony 9 Commercial District:
TU_DEBUG=noubwcdrew the roads right.TU_DEBUG=sysmem,TU_DEBUG=nolrz,DM_VK_UBWC=0andDM_VK_ZSHARE=0did not.TU_DEBUG, and the frame time is unchanged (33.6 ms).The native build passes on this branch.
Proof (AYN Thor, Colony 9 Commercial District)