Skip to content

graphics: Improve handling of color buffer and storage image swizzles #1763

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

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

raphaelthegreat
Copy link
Contributor

@raphaelthegreat raphaelthegreat commented Dec 13, 2024

  • Removed some color buffer component swaps that were wrong since eR8G8B8A8Unorm and eA8B8G8R8UnormPack32 are technically the same format for little-endian GPUs, which both AMD and NVIDIA are. This lets the shader specialization mechanism handle it instead.

  • Handle swizzles for storage image writes by swizzling incoming texel in the shader, as well as format buffer swizzles since BUFFER_LOAD_FORMAT and BUFFER_STORE_FORMAT use dst_sel from the sharp. For storage images specifically we only perform manual swizzling if the format isn't 8_8_8_8 since those can be swizzled with image view and is already mostly handled

  • Ignore mrtz stencil exports since those are unsupported for now

* Platform support is not always guaranteed
@raphaelthegreat raphaelthegreat merged commit 722a0e3 into main Dec 13, 2024
20 checks passed
diegolix29 pushed a commit to diegolix29/shadPS4 that referenced this pull request Dec 14, 2024
…shadps4-emu#1763)

* liverpool_to_vk: Remove wrong component swap formats

* shader_recompiler: Handle storage and buffer format swizzles

* shader_recompiler: Skip unsupported depth export

* image_view: Remove image format swizzle

* Platform support is not always guaranteed
@polybiusproxy polybiusproxy deleted the better-swizzle branch December 16, 2024 18:36
diegolix29 added a commit to diegolix29/shadPS4 that referenced this pull request Dec 26, 2024
Xcedf pushed a commit to Xcedf/shadPS4 that referenced this pull request Dec 28, 2024
…shadps4-emu#1763)

* liverpool_to_vk: Remove wrong component swap formats

* shader_recompiler: Handle storage and buffer format swizzles

* shader_recompiler: Skip unsupported depth export

* image_view: Remove image format swizzle

* Platform support is not always guaranteed
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.

2 participants