mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[PR #1762] [MERGED] shader_recompiler: Emulate unnormalized sampler coordinates in shader. #2285
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#2285
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/1762
Author: @squidbus
Created: 12/13/2024
Status: ✅ Merged
Merged: 12/13/2024
Merged by: @raphaelthegreat
Base:
main← Head:unnorm📝 Commits (2)
cb7c049shader_recompiler: Emulate unnormalized sampler coordinates in shader.d303a4dAddress review comments.📊 Changes
10 files changed (+78 additions, -12 deletions)
View changed files
📝
src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp(+8 -0)📝
src/shader_recompiler/backend/spirv/emit_spirv_instructions.h(+2 -0)📝
src/shader_recompiler/frontend/translate/vector_memory.cpp(+1 -0)📝
src/shader_recompiler/ir/ir_emitter.cpp(+14 -0)📝
src/shader_recompiler/ir/ir_emitter.h(+1 -0)📝
src/shader_recompiler/ir/opcodes.inc(+2 -0)📝
src/shader_recompiler/ir/passes/resource_tracking_pass.cpp(+31 -10)📝
src/shader_recompiler/ir/reg.h(+2 -1)📝
src/shader_recompiler/specialization.h(+16 -0)📝
src/video_core/texture_cache/sampler.cpp(+1 -1)📄 Description
Vulkan imposes a number of restrictions on samplers with
unnormalizedCoordinates = true. In most cases seeingforce_unnormalizedused by games, these restrictions seem to be violated, using address modes, compare ops, LOD levels, and sampling instructions that are not allowed.Instead, emulate unnormalized coordinates in shaders by querying the dimensions and dividing the unnormalized coordinates to turn them into normalized coordinates. This also allows us to implement the unnormalized per-instruction flag.
Used by some shaders in CUSA16404 and CUSA05637.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.