open [12303] texture_pass: Fix wrong descriptor used with rectangle texture patching #12303

Open
Accord wants to merge 1 commit from __refs_pull_12303_head into master
Owner

Branch: __refs_pull_12303_head

GPUCode opened issue at 2023-12-07 22:24:

PatchImageSampleImplicitLod will emit ImageQueryDimension which inherits the IR::TextureInstInfo from the instruction. However the descriptor_index is resolved in the second switch statement, which means that the query instruction wont query the correct texture in some cases.

Before After

bad | good

legend800 commented at 2023-12-17 23:53:

Given the review only had a hardcoding callout, can we tag to EA to get this long-standing defect resolved there and for additional test coverage.

GPUCode commented at 2023-12-18 00:13:

This PR as it currently stands breaks some games like Amnesia even more from what @Kelebek1 found (admittedly it was also broken before), so it needs a more complete handling of coordinate normalization with rectangle textures (making the property a uniform has been proposed).
Ideally it would be possible to relatively easily generate multiple host shaders from a combination of the maxwell binary and dynamic state but the current system makes this difficult. I'll find some time this week to correct the review and try to see if the uniform approach can be implemented here, otherwise might need a separate PR

[Export of Github issue for yuzu-emu/yuzu. Generated on 2024.02.28 at 10:04:32.]

**Branch:** [__refs_pull_12303_head](https://accord.dravee.dev/Accord/yuzu-mirror/src/branch/__refs_pull_12303_head) #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/47210458?u=13aa675feedd2375400f7359cbd089b57dfcd200&v=4" width="50"></div>[GPUCode](https://github.com/GPUCode) opened issue at [2023-12-07 22:24](https://github.com/yuzu-emu/yuzu/pull/12303): > PatchImageSampleImplicitLod will emit ImageQueryDimension which inherits the IR::TextureInstInfo from the instruction. However the descriptor_index is resolved in the second switch statement, which means that the query instruction wont query the correct texture in some cases. > | Before | After | > |---|---| ![bad](https://github.com/yuzu-emu/yuzu/assets/47210458/71a75d38-b7be-41be-b210-e326828eb5dc) | ![good](https://github.com/yuzu-emu/yuzu/assets/47210458/da416ea1-ea94-4efd-bd34-591516710276) #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/20983844?u=d791bf775d9976836094a3ea1955a0f22d3c5243&v=4" width="50"></div>[legend800](https://github.com/legend800) commented at [2023-12-17 23:53](https://github.com/yuzu-emu/yuzu/pull/12303#issuecomment-1859329736): > Given the review only had a hardcoding callout, can we tag to EA to get this long-standing defect resolved there and for additional test coverage. #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/47210458?u=13aa675feedd2375400f7359cbd089b57dfcd200&v=4" width="50"></div>[GPUCode](https://github.com/GPUCode) commented at [2023-12-18 00:13](https://github.com/yuzu-emu/yuzu/pull/12303#issuecomment-1859339590): > This PR as it currently stands breaks some games like Amnesia even more from what @Kelebek1 found (admittedly it was also broken before), so it needs a more complete handling of coordinate normalization with rectangle textures (making the property a uniform has been proposed). > Ideally it would be possible to relatively easily generate multiple host shaders from a combination of the maxwell binary and dynamic state but the current system makes this difficult. I'll find some time this week to correct the review and try to see if the uniform approach can be implemented here, otherwise might need a separate PR > ------------------------------------------------------------------------------- > [Export of Github issue for [yuzu-emu/yuzu](https://github.com/yuzu-emu/yuzu). Generated on 2024.02.28 at 10:04:32.]
texture_pass: Fix wrong descriptor used with rectangle texture patching
Some checks failed
yuzu verify / test build (macos) (pull_request) Has been cancelled
yuzu verify / test build (windows, msvc) (pull_request) Has been cancelled
yuzu-ci / transifex (pull_request) Has been cancelled
yuzu-ci / reuse (pull_request) Has been cancelled
codespell / Check for spelling errors (pull_request) Has been cancelled
yuzu verify / verify format (pull_request) Has been cancelled
yuzu verify / android (pull_request) Has been cancelled
yuzu verify / test build (pull_request) Has been cancelled
yuzu verify / test build-1 (pull_request) Has been cancelled
yuzu verify / test build-2 (pull_request) Has been cancelled
a7caa07fdd
Some checks failed
yuzu verify / test build (macos) (pull_request) Has been cancelled
yuzu verify / test build (windows, msvc) (pull_request) Has been cancelled
yuzu-ci / transifex (pull_request) Has been cancelled
yuzu-ci / reuse (pull_request) Has been cancelled
codespell / Check for spelling errors (pull_request) Has been cancelled
yuzu verify / verify format (pull_request) Has been cancelled
yuzu verify / android (pull_request) Has been cancelled
yuzu verify / test build (pull_request) Has been cancelled
yuzu verify / test build-1 (pull_request) Has been cancelled
yuzu verify / test build-2 (pull_request) Has been cancelled
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin __refs_pull_12303_head:__refs_pull_12303_head
git switch __refs_pull_12303_head

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff __refs_pull_12303_head
git switch __refs_pull_12303_head
git rebase master
git switch master
git merge --ff-only __refs_pull_12303_head
git switch __refs_pull_12303_head
git rebase master
git switch master
git merge --no-ff __refs_pull_12303_head
git switch master
git merge --squash __refs_pull_12303_head
git switch master
git merge --ff-only __refs_pull_12303_head
git switch master
git merge __refs_pull_12303_head
git push origin master
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Accord/yuzu-mirror!12303
No description provided.