mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 16:25:58 +03:00
[PR #2266] [MERGED] shader_recompiler: Fix cube sampling coordinates. #2608
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#2608
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/2266
Author: @squidbus
Created: 1/29/2025
Status: ✅ Merged
Merged: 1/30/2025
Merged by: @squidbus
Base:
main← Head:fix-cube📝 Commits (1)
cd20260shader_recompiler: Fix cube sampling coordinates.📊 Changes
2 files changed (+21 additions, -6 deletions)
View changed files
📝
src/shader_recompiler/ir/passes/resource_tracking_pass.cpp(+19 -6)📝
src/shader_recompiler/specialization.h(+2 -0)📄 Description
AMD adds
1.5to cube coordinates to put them in the range[1.0, 2.0], see here for more details: https://gpuopen.com/learn/fetching-from-cubes-and-octahedrons/We need the coordinates in the range
[0.0, 1.0]for sampling, so subtract1.ffrom each coordinate. As a result we also need shader specialization for whether an image is a cube, to emit the right coordinate fix-up. This likely won't vary too much, as when cube calculations are used the image should basically always be a cube.Fixes incorrect character lighting in CUSA06093.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.