Skip to content
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

shader_recompiler: Improvements to array and cube handling. #2083

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

squidbus
Copy link
Collaborator

@squidbus squidbus commented Jan 7, 2025

Enhances handling of array and cube images:

  • Image sharps may have an array type, but in the actual shader the image is accessed with the array flag not set. In this case we should override the image to the proper non-array variant and avoid indexing as an array.
    • Fixes missing rendering in CUSA28193. Multiple shaders would have a 2D texture array bound but address it as a single layer, with the register used for the array index being invalid.
  • Handles array flag for all MIMG instructions instead of just sampling instructions.
  • Converts cubes to 2D arrays. This helps deal with cases where layers are not a multiple of 6 for whatever reason, and also enables derivatives and offsets on cube images, which are not possible with Vulkan cube images.

@squidbus squidbus marked this pull request as draft January 7, 2025 11:53
@squidbus
Copy link
Collaborator Author

squidbus commented Jan 7, 2025

Fixed a cube array crash, so no longer draft.

@squidbus squidbus marked this pull request as ready for review January 7, 2025 12:43
@squidbus squidbus changed the title shader_recompiler: Account for instruction array flag in image type. shader_recompiler: Improvements to array and cube handling. Jan 7, 2025
@StevenMiller123
Copy link
Contributor

Improves Final Fantasy XV Episode Duscae (previously crashed on [Debug] <Critical> resource_tracking_pass.cpp:operator():570: Assertion Failed!, now crashes on [Debug] <Critical> tile_manager.cpp:operator():262: Assertion Failed!)
PR log.txt
main log.txt

@DanielSvoboda
Copy link
Contributor

This also makes it possible to see in the games Elden Rind and SONIC X SHADOW GENERATIONS, as currently everything is black.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants