mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-24 21:55:57 +00:00
Merge pull request #701, translator patch 0014 out so DLSS stops shaking the picture (itaskaev2)
Measured on an RTX 4080 SUPER by the author: shift 0.86 px a frame with the patch, 0.00 without it.
Review note: 0014 alone moves the SPIR-V hash of the game's FXAA shader from 5c43ae18948d52cb, which is in FXAA_FS
(runtime/vk_dlaa.c vk_dlaa_skip_draw), to aad42238801d31d8, which is not. With the initializers removed and the id gaps
closed, the 0014 build's shader disassembles identically to the pre-0014 one. So since c0e66fe the FXAA list matched
nothing, and this merge makes it match again, which also brings back fxaa = 0. The hash miss is the likely cause of the
shake rather than a driver reaction to OpConstantNull, but the path from the missed skip to the screen is not traced and
no RTX run checked it. Not run here: translator build, game run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
3ae9e8360d
3 files changed
+4
-22
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"""Build the shader translator: build/xlate/totk_xlate.exe (Ryujinx 1.3.2 + patches, NativeAOT, SPIR-V for Vulkan).
|
||||
|
||||
Copies tools/vendor/ryujinx to build/xlate/ryujinx, applies tools/xlate/patches/*.patch there (tools/vendor stays
|
||||
byte-identical; 0001-0004 are MNG's, 0005-0014 are ours), then runs `dotnet publish`. Needs the .NET 10 SDK, the MSVC build
|
||||
byte-identical; 0001-0004 are MNG's, 0005-0013 and 0015 are ours), then runs `dotnet publish`. Needs the .NET 10 SDK, the MSVC build
|
||||
tools and vswhere.exe (docs/building.md). Run with .venv. On Linux it builds build/xlate/totk_xlate for linux-x64, which
|
||||
NativeAOT links with the system's clang (no MSVC); NativeAOT builds for the OS it runs on only.
|
||||
|
||||
@@ -99,8 +99,8 @@ def prepare_sources() -> Path:
|
||||
for junk in list(src.glob("src/*/obj")) + list(src.glob("src/*/bin")):
|
||||
shutil.rmtree(junk)
|
||||
patches = sorted((XLATE / "patches").glob("*.patch"))
|
||||
if len(patches) != 15:
|
||||
sys.exit(f"expected 15 patches, found {len(patches)}")
|
||||
if len(patches) != 14:
|
||||
sys.exit(f"expected 14 patches, found {len(patches)}")
|
||||
for patch in patches:
|
||||
# git apply works outside a repository when given a directory; --check first so a failure names the patch.
|
||||
for extra in (["--check"], []):
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--- a/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs
|
||||
+++ b/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs
|
||||
@@ -33,8 +33,13 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
||||
{
|
||||
foreach (AstOperand local in function.Locals)
|
||||
{
|
||||
- SpvInstruction localPointerType = context.TypePointer(StorageClass.Function, context.GetType(local.VarType));
|
||||
- SpvInstruction spvLocal = context.Variable(localPointerType, StorageClass.Function);
|
||||
+ SpvInstruction localType = context.GetType(local.VarType);
|
||||
+ SpvInstruction localPointerType = context.TypePointer(StorageClass.Function, localType);
|
||||
+
|
||||
+ // TOTK: a register read on a path that did not write it reads 0. Without an initializer the load is
|
||||
+ // undefined, and a compiler that folds undefined values (Mesa's, on the Steam Deck) may compute anything
|
||||
+ // from it.
|
||||
+ SpvInstruction spvLocal = context.Variable(localPointerType, StorageClass.Function, context.ConstantNull(localType));
|
||||
|
||||
context.AddLocalVariable(spvLocal);
|
||||
context.DeclareLocal(local, spvLocal);
|
||||
Reference in new issue
Block a user