mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-19 20:25:57 +00:00
Merge pull request #566: DLSS's picture reaches the screen, camera motion in double precision, the camera rune's half-size pass leaves DLSS armed (mictony6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
6dd08db962
7 files changed
+195
-182
No files matched your search
+77
-112
@@ -1,119 +1,84 @@
|
||||
// Generated by tools/build_shaders.py from runtime/shaders/dlaa_mv.comp; do not edit.
|
||||
// source sha256 bfa9b6d9e0f9d5cfd4382fa5080fa46f007a1a4e2b886b8fecd9adba11767686
|
||||
// source sha256 f5ddb0e90c78900c1bdabb45d7c2fc44febae07e39dc0931ed1b47beefa2414e
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
static const uint32_t dlaa_mv_spv[] = {
|
||||
0x07230203, 0x00010600, 0x0008000b, 0x00000131, 0x00000000, 0x00020011, 0x00000001, 0x00020011,
|
||||
0x07230203, 0x00010300, 0x000d000b, 0x000000a5, 0x00000000, 0x00020011, 0x00000001, 0x00020011,
|
||||
0x00000031, 0x0006000b, 0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e,
|
||||
0x00000000, 0x00000001, 0x000b000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x00000036,
|
||||
0x00000043, 0x0000005d, 0x00000089, 0x000000a0, 0x000000e7, 0x00060010, 0x00000004, 0x00000011,
|
||||
0x00000008, 0x00000008, 0x00000001, 0x00030003, 0x00000002, 0x000001c2, 0x00040005, 0x00000004,
|
||||
0x6e69616d, 0x00000000, 0x00080005, 0x00000036, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f,
|
||||
0x496e6f69, 0x00000044, 0x00030005, 0x00000041, 0x00000050, 0x00050006, 0x00000041, 0x00000000,
|
||||
0x657a6973, 0x00000000, 0x00050006, 0x00000041, 0x00000001, 0x7474696a, 0x00007265, 0x00030005,
|
||||
0x00000043, 0x00006370, 0x00050005, 0x0000005d, 0x74706564, 0x65745f68, 0x00000078, 0x00030005,
|
||||
0x00000087, 0x00727543, 0x00040006, 0x00000087, 0x00000000, 0x00000072, 0x00030005, 0x00000089,
|
||||
0x00727563, 0x00040005, 0x0000009e, 0x76657250, 0x00000000, 0x00040006, 0x0000009e, 0x00000000,
|
||||
0x00000072, 0x00040005, 0x000000a0, 0x76657270, 0x00000000, 0x00040005, 0x000000e7, 0x6f5f766d,
|
||||
0x00007475, 0x00040047, 0x00000036, 0x0000000b, 0x0000001c, 0x00030047, 0x00000041, 0x00000002,
|
||||
0x00050048, 0x00000041, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000041, 0x00000001,
|
||||
0x00000023, 0x00000008, 0x00040047, 0x0000005d, 0x00000021, 0x00000000, 0x00040047, 0x0000005d,
|
||||
0x00000022, 0x00000000, 0x00040047, 0x00000086, 0x00000006, 0x00000010, 0x00030047, 0x00000087,
|
||||
0x00000002, 0x00050048, 0x00000087, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000089,
|
||||
0x00000021, 0x00000002, 0x00040047, 0x00000089, 0x00000022, 0x00000000, 0x00040047, 0x0000009d,
|
||||
0x00000006, 0x00000010, 0x00030047, 0x0000009e, 0x00000002, 0x00050048, 0x0000009e, 0x00000000,
|
||||
0x00000023, 0x00000000, 0x00040047, 0x000000a0, 0x00000021, 0x00000003, 0x00040047, 0x000000a0,
|
||||
0x00000022, 0x00000000, 0x00030047, 0x000000e7, 0x00000019, 0x00040047, 0x000000e7, 0x00000021,
|
||||
0x00000001, 0x00040047, 0x000000e7, 0x00000022, 0x00000000, 0x00020013, 0x00000002, 0x00030021,
|
||||
0x00000003, 0x00000002, 0x00030016, 0x00000006, 0x00000020, 0x00040017, 0x00000007, 0x00000006,
|
||||
0x00000004, 0x00040018, 0x00000009, 0x00000007, 0x00000004, 0x0004002b, 0x00000006, 0x00000015,
|
||||
0x3f800000, 0x0004002b, 0x00000006, 0x00000016, 0x00000000, 0x00040015, 0x0000002f, 0x00000020,
|
||||
0x00000001, 0x00040017, 0x00000030, 0x0000002f, 0x00000002, 0x00040015, 0x00000033, 0x00000020,
|
||||
0x00000000, 0x00040017, 0x00000034, 0x00000033, 0x00000003, 0x00040020, 0x00000035, 0x00000001,
|
||||
0x00000034, 0x0004003b, 0x00000035, 0x00000036, 0x00000001, 0x00040017, 0x00000037, 0x00000033,
|
||||
0x00000002, 0x00020014, 0x0000003b, 0x0004002b, 0x00000033, 0x0000003c, 0x00000000, 0x00040017,
|
||||
0x00000040, 0x00000006, 0x00000002, 0x0004001e, 0x00000041, 0x00000040, 0x00000040, 0x00040020,
|
||||
0x00000042, 0x00000009, 0x00000041, 0x0004003b, 0x00000042, 0x00000043, 0x00000009, 0x0004002b,
|
||||
0x0000002f, 0x00000044, 0x00000000, 0x00040020, 0x00000045, 0x00000009, 0x00000006, 0x0004002b,
|
||||
0x00000033, 0x0000004d, 0x00000001, 0x00090019, 0x0000005a, 0x00000006, 0x00000001, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x0003001b, 0x0000005b, 0x0000005a, 0x00040020,
|
||||
0x0000005c, 0x00000000, 0x0000005b, 0x0004003b, 0x0000005c, 0x0000005d, 0x00000000, 0x0004002b,
|
||||
0x00000006, 0x00000067, 0x3f000000, 0x0004002b, 0x0000002f, 0x0000006a, 0x00000001, 0x00040020,
|
||||
0x0000006b, 0x00000009, 0x00000040, 0x0004002b, 0x00000006, 0x00000075, 0x40000000, 0x0004002b,
|
||||
0x00000033, 0x00000085, 0x00000010, 0x0004001c, 0x00000086, 0x00000007, 0x00000085, 0x0003001e,
|
||||
0x00000087, 0x00000086, 0x00040020, 0x00000088, 0x00000002, 0x00000087, 0x0004003b, 0x00000088,
|
||||
0x00000089, 0x00000002, 0x0004002b, 0x0000002f, 0x0000008a, 0x00000003, 0x0004002b, 0x0000002f,
|
||||
0x0000008b, 0x00000004, 0x0004002b, 0x0000002f, 0x0000008c, 0x00000005, 0x0004002b, 0x0000002f,
|
||||
0x0000008d, 0x00000006, 0x00040020, 0x0000008f, 0x00000002, 0x00000007, 0x0004001c, 0x0000009d,
|
||||
0x00000007, 0x00000085, 0x0003001e, 0x0000009e, 0x0000009d, 0x00040020, 0x0000009f, 0x00000002,
|
||||
0x0000009e, 0x0004003b, 0x0000009f, 0x000000a0, 0x00000002, 0x0005002c, 0x00000040, 0x000000b4,
|
||||
0x00000016, 0x00000016, 0x0004002b, 0x00000006, 0x000000b9, 0x2b8cbccc, 0x0004002b, 0x00000006,
|
||||
0x000000c7, 0x358637bd, 0x00090019, 0x000000e5, 0x00000006, 0x00000001, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000002, 0x00000007, 0x00040020, 0x000000e6, 0x00000000, 0x000000e5, 0x0004003b,
|
||||
0x000000e6, 0x000000e7, 0x00000000, 0x0005002c, 0x00000040, 0x00000130, 0x00000067, 0x00000067,
|
||||
0x00000000, 0x00000001, 0x0006000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000d,
|
||||
0x00060010, 0x00000004, 0x00000011, 0x00000008, 0x00000008, 0x00000001, 0x00040047, 0x0000000d,
|
||||
0x0000000b, 0x0000001c, 0x00030047, 0x0000001b, 0x00000002, 0x00040048, 0x0000001b, 0x00000000,
|
||||
0x00000005, 0x00050048, 0x0000001b, 0x00000000, 0x00000007, 0x00000010, 0x00050048, 0x0000001b,
|
||||
0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x0000001b, 0x00000001, 0x00000023, 0x00000040,
|
||||
0x00050048, 0x0000001b, 0x00000002, 0x00000023, 0x00000048, 0x00040047, 0x00000037, 0x00000021,
|
||||
0x00000000, 0x00040047, 0x00000037, 0x00000022, 0x00000000, 0x00030047, 0x0000008c, 0x00000019,
|
||||
0x00040047, 0x0000008c, 0x00000021, 0x00000001, 0x00040047, 0x0000008c, 0x00000022, 0x00000000,
|
||||
0x00040047, 0x00000094, 0x0000000b, 0x00000019, 0x00020013, 0x00000002, 0x00030021, 0x00000003,
|
||||
0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000001, 0x00040017, 0x00000007, 0x00000006,
|
||||
0x00000002, 0x00040015, 0x0000000a, 0x00000020, 0x00000000, 0x00040017, 0x0000000b, 0x0000000a,
|
||||
0x00000003, 0x00040020, 0x0000000c, 0x00000001, 0x0000000b, 0x0004003b, 0x0000000c, 0x0000000d,
|
||||
0x00000001, 0x00040017, 0x0000000e, 0x0000000a, 0x00000002, 0x00020014, 0x00000012, 0x0004002b,
|
||||
0x0000000a, 0x00000013, 0x00000000, 0x00030016, 0x00000017, 0x00000020, 0x00040017, 0x00000018,
|
||||
0x00000017, 0x00000004, 0x00040018, 0x00000019, 0x00000018, 0x00000004, 0x00040017, 0x0000001a,
|
||||
0x00000017, 0x00000002, 0x0005001e, 0x0000001b, 0x00000019, 0x0000001a, 0x0000001a, 0x00040020,
|
||||
0x0000001c, 0x00000009, 0x0000001b, 0x0004003b, 0x0000001c, 0x0000001d, 0x00000009, 0x0004002b,
|
||||
0x00000006, 0x0000001e, 0x00000001, 0x00040020, 0x0000001f, 0x00000009, 0x00000017, 0x0004002b,
|
||||
0x0000000a, 0x00000027, 0x00000001, 0x00090019, 0x00000034, 0x00000017, 0x00000001, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x0003001b, 0x00000035, 0x00000034, 0x00040020,
|
||||
0x00000036, 0x00000000, 0x00000035, 0x0004003b, 0x00000036, 0x00000037, 0x00000000, 0x0004002b,
|
||||
0x00000006, 0x0000003a, 0x00000000, 0x0004002b, 0x00000017, 0x00000042, 0x3f000000, 0x0004002b,
|
||||
0x00000006, 0x00000045, 0x00000002, 0x00040020, 0x00000046, 0x00000009, 0x0000001a, 0x0004002b,
|
||||
0x00000017, 0x00000051, 0x40000000, 0x0004002b, 0x00000017, 0x00000053, 0x3f800000, 0x00040020,
|
||||
0x00000061, 0x00000009, 0x00000019, 0x0004002b, 0x00000017, 0x00000067, 0x00000000, 0x0005002c,
|
||||
0x0000001a, 0x00000068, 0x00000067, 0x00000067, 0x0004002b, 0x00000017, 0x0000006c, 0x358637bd,
|
||||
0x00090019, 0x0000008a, 0x00000017, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002,
|
||||
0x00000007, 0x00040020, 0x0000008b, 0x00000000, 0x0000008a, 0x0004003b, 0x0000008b, 0x0000008c,
|
||||
0x00000000, 0x0004002b, 0x0000000a, 0x00000093, 0x00000008, 0x0006002c, 0x0000000b, 0x00000094,
|
||||
0x00000093, 0x00000093, 0x00000027, 0x0005002c, 0x0000001a, 0x000000a4, 0x00000042, 0x00000042,
|
||||
0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x000300f7,
|
||||
0x000000f0, 0x00000000, 0x000300fb, 0x0000003c, 0x000000f1, 0x000200f8, 0x000000f1, 0x0004003d,
|
||||
0x00000034, 0x00000038, 0x00000036, 0x0007004f, 0x00000037, 0x00000039, 0x00000038, 0x00000038,
|
||||
0x00000000, 0x00000001, 0x0004007c, 0x00000030, 0x0000003a, 0x00000039, 0x00050051, 0x0000002f,
|
||||
0x0000003f, 0x0000003a, 0x00000000, 0x00060041, 0x00000045, 0x00000046, 0x00000043, 0x00000044,
|
||||
0x0000003c, 0x0004003d, 0x00000006, 0x00000047, 0x00000046, 0x0004006e, 0x0000002f, 0x00000048,
|
||||
0x00000047, 0x000500af, 0x0000003b, 0x00000049, 0x0000003f, 0x00000048, 0x000400a8, 0x0000003b,
|
||||
0x0000004a, 0x00000049, 0x000300f7, 0x0000004c, 0x00000000, 0x000400fa, 0x0000004a, 0x0000004b,
|
||||
0x0000004c, 0x000200f8, 0x0000004b, 0x00050051, 0x0000002f, 0x0000004f, 0x0000003a, 0x00000001,
|
||||
0x00060041, 0x00000045, 0x00000050, 0x00000043, 0x00000044, 0x0000004d, 0x0004003d, 0x00000006,
|
||||
0x00000051, 0x00000050, 0x0004006e, 0x0000002f, 0x00000052, 0x00000051, 0x000500af, 0x0000003b,
|
||||
0x00000053, 0x0000004f, 0x00000052, 0x000200f9, 0x0000004c, 0x000200f8, 0x0000004c, 0x000700f5,
|
||||
0x0000003b, 0x00000054, 0x00000049, 0x000000f1, 0x00000053, 0x0000004b, 0x000300f7, 0x00000056,
|
||||
0x00000000, 0x000400fa, 0x00000054, 0x00000055, 0x00000056, 0x000200f8, 0x00000055, 0x000200f9,
|
||||
0x000000f0, 0x000200f8, 0x00000056, 0x0004003d, 0x0000005b, 0x0000005e, 0x0000005d, 0x00040064,
|
||||
0x0000005a, 0x00000060, 0x0000005e, 0x0007005f, 0x00000007, 0x00000061, 0x00000060, 0x0000003a,
|
||||
0x00000002, 0x00000044, 0x00050051, 0x00000006, 0x00000062, 0x00000061, 0x00000000, 0x0004006f,
|
||||
0x00000040, 0x00000066, 0x0000003a, 0x00050081, 0x00000040, 0x00000069, 0x00000066, 0x00000130,
|
||||
0x00050041, 0x0000006b, 0x0000006c, 0x00000043, 0x0000006a, 0x0004003d, 0x00000040, 0x0000006d,
|
||||
0x0000006c, 0x00050083, 0x00000040, 0x0000006e, 0x00000069, 0x0000006d, 0x00050051, 0x00000006,
|
||||
0x00000071, 0x0000006e, 0x00000000, 0x00050088, 0x00000006, 0x00000074, 0x00000071, 0x00000047,
|
||||
0x00050085, 0x00000006, 0x00000076, 0x00000074, 0x00000075, 0x00050083, 0x00000006, 0x00000077,
|
||||
0x00000076, 0x00000015, 0x00050051, 0x00000006, 0x00000079, 0x0000006e, 0x00000001, 0x00060041,
|
||||
0x00000045, 0x0000007a, 0x00000043, 0x00000044, 0x0000004d, 0x0004003d, 0x00000006, 0x0000007b,
|
||||
0x0000007a, 0x00050088, 0x00000006, 0x0000007c, 0x00000079, 0x0000007b, 0x00050085, 0x00000006,
|
||||
0x0000007d, 0x0000007c, 0x00000075, 0x00050083, 0x00000006, 0x0000007e, 0x00000015, 0x0000007d,
|
||||
0x00050085, 0x00000006, 0x00000080, 0x00000062, 0x00000075, 0x00050083, 0x00000006, 0x00000081,
|
||||
0x00000080, 0x00000015, 0x00070050, 0x00000007, 0x00000082, 0x00000077, 0x0000007e, 0x00000081,
|
||||
0x00000015, 0x00060041, 0x0000008f, 0x00000090, 0x00000089, 0x00000044, 0x0000008a, 0x0004003d,
|
||||
0x00000007, 0x00000091, 0x00000090, 0x00060041, 0x0000008f, 0x00000093, 0x00000089, 0x00000044,
|
||||
0x0000008b, 0x0004003d, 0x00000007, 0x00000094, 0x00000093, 0x00060041, 0x0000008f, 0x00000096,
|
||||
0x00000089, 0x00000044, 0x0000008c, 0x0004003d, 0x00000007, 0x00000097, 0x00000096, 0x00060041,
|
||||
0x0000008f, 0x00000099, 0x00000089, 0x00000044, 0x0000008d, 0x0004003d, 0x00000007, 0x0000009a,
|
||||
0x00000099, 0x00070050, 0x00000009, 0x00000110, 0x00000091, 0x00000094, 0x00000097, 0x0000009a,
|
||||
0x00040054, 0x00000009, 0x00000111, 0x00000110, 0x00060041, 0x0000008f, 0x000000a2, 0x000000a0,
|
||||
0x00000044, 0x0000008a, 0x0004003d, 0x00000007, 0x000000a3, 0x000000a2, 0x00060041, 0x0000008f,
|
||||
0x000000a5, 0x000000a0, 0x00000044, 0x0000008b, 0x0004003d, 0x00000007, 0x000000a6, 0x000000a5,
|
||||
0x00060041, 0x0000008f, 0x000000a8, 0x000000a0, 0x00000044, 0x0000008c, 0x0004003d, 0x00000007,
|
||||
0x000000a9, 0x000000a8, 0x00060041, 0x0000008f, 0x000000ab, 0x000000a0, 0x00000044, 0x0000008d,
|
||||
0x0004003d, 0x00000007, 0x000000ac, 0x000000ab, 0x00070050, 0x00000009, 0x0000012c, 0x000000a3,
|
||||
0x000000a6, 0x000000a9, 0x000000ac, 0x00040054, 0x00000009, 0x0000012d, 0x0000012c, 0x0006000c,
|
||||
0x00000009, 0x000000b0, 0x00000001, 0x00000022, 0x00000111, 0x00050091, 0x00000007, 0x000000b2,
|
||||
0x000000b0, 0x00000082, 0x00050051, 0x00000006, 0x000000b7, 0x000000b2, 0x00000003, 0x0006000c,
|
||||
0x00000006, 0x000000b8, 0x00000001, 0x00000004, 0x000000b7, 0x000500ba, 0x0000003b, 0x000000ba,
|
||||
0x000000b8, 0x000000b9, 0x000300f7, 0x000000bc, 0x00000000, 0x000400fa, 0x000000ba, 0x000000bb,
|
||||
0x000000bc, 0x000200f8, 0x000000bb, 0x00070050, 0x00000007, 0x000000c2, 0x000000b7, 0x000000b7,
|
||||
0x000000b7, 0x000000b7, 0x00050088, 0x00000007, 0x000000c3, 0x000000b2, 0x000000c2, 0x00050091,
|
||||
0x00000007, 0x000000c4, 0x0000012d, 0x000000c3, 0x00050051, 0x00000006, 0x000000c6, 0x000000c4,
|
||||
0x00000003, 0x000500ba, 0x0000003b, 0x000000c8, 0x000000c6, 0x000000c7, 0x000300f7, 0x000000ca,
|
||||
0x00000000, 0x000400fa, 0x000000c8, 0x000000c9, 0x000000ca, 0x000200f8, 0x000000c9, 0x0007004f,
|
||||
0x00000040, 0x000000cd, 0x000000c4, 0x000000c4, 0x00000000, 0x00000001, 0x00050050, 0x00000040,
|
||||
0x000000d0, 0x000000c6, 0x000000c6, 0x00050088, 0x00000040, 0x000000d1, 0x000000cd, 0x000000d0,
|
||||
0x00050051, 0x00000006, 0x000000d4, 0x000000d1, 0x00000000, 0x00050085, 0x00000006, 0x000000d5,
|
||||
0x000000d4, 0x00000067, 0x00050081, 0x00000006, 0x000000d6, 0x000000d5, 0x00000067, 0x00050085,
|
||||
0x00000006, 0x000000d9, 0x000000d6, 0x00000047, 0x00050051, 0x00000006, 0x000000db, 0x000000d1,
|
||||
0x00000001, 0x00050085, 0x00000006, 0x000000dc, 0x000000db, 0x00000067, 0x00050083, 0x00000006,
|
||||
0x000000dd, 0x00000067, 0x000000dc, 0x00050085, 0x00000006, 0x000000e0, 0x000000dd, 0x0000007b,
|
||||
0x00050050, 0x00000040, 0x000000e1, 0x000000d9, 0x000000e0, 0x00050083, 0x00000040, 0x000000e4,
|
||||
0x000000e1, 0x0000006e, 0x000200f9, 0x000000ca, 0x000200f8, 0x000000ca, 0x000700f5, 0x00000040,
|
||||
0x0000012f, 0x000000b4, 0x000000bb, 0x000000e4, 0x000000c9, 0x000200f9, 0x000000bc, 0x000200f8,
|
||||
0x000000bc, 0x000700f5, 0x00000040, 0x0000012e, 0x000000b4, 0x00000056, 0x0000012f, 0x000000ca,
|
||||
0x0004003d, 0x000000e5, 0x000000e8, 0x000000e7, 0x00050051, 0x00000006, 0x000000eb, 0x0000012e,
|
||||
0x00000000, 0x00050051, 0x00000006, 0x000000ec, 0x0000012e, 0x00000001, 0x00070050, 0x00000007,
|
||||
0x000000ed, 0x000000eb, 0x000000ec, 0x00000016, 0x00000016, 0x00040063, 0x000000e8, 0x0000003a,
|
||||
0x000000ed, 0x000200f9, 0x000000f0, 0x000200f8, 0x000000f0, 0x000100fd, 0x00010038,
|
||||
0x00000095, 0x00000000, 0x000300fb, 0x00000013, 0x00000096, 0x000200f8, 0x00000096, 0x0004003d,
|
||||
0x0000000b, 0x0000000f, 0x0000000d, 0x0007004f, 0x0000000e, 0x00000010, 0x0000000f, 0x0000000f,
|
||||
0x00000000, 0x00000001, 0x0004007c, 0x00000007, 0x00000011, 0x00000010, 0x00050051, 0x00000006,
|
||||
0x00000016, 0x00000011, 0x00000000, 0x00060041, 0x0000001f, 0x00000020, 0x0000001d, 0x0000001e,
|
||||
0x00000013, 0x0004003d, 0x00000017, 0x00000021, 0x00000020, 0x0004006e, 0x00000006, 0x00000022,
|
||||
0x00000021, 0x000500af, 0x00000012, 0x00000023, 0x00000016, 0x00000022, 0x000400a8, 0x00000012,
|
||||
0x00000024, 0x00000023, 0x000300f7, 0x00000026, 0x00000000, 0x000400fa, 0x00000024, 0x00000025,
|
||||
0x00000026, 0x000200f8, 0x00000025, 0x00050051, 0x00000006, 0x00000029, 0x00000011, 0x00000001,
|
||||
0x00060041, 0x0000001f, 0x0000002a, 0x0000001d, 0x0000001e, 0x00000027, 0x0004003d, 0x00000017,
|
||||
0x0000002b, 0x0000002a, 0x0004006e, 0x00000006, 0x0000002c, 0x0000002b, 0x000500af, 0x00000012,
|
||||
0x0000002d, 0x00000029, 0x0000002c, 0x000200f9, 0x00000026, 0x000200f8, 0x00000026, 0x000700f5,
|
||||
0x00000012, 0x0000002e, 0x00000023, 0x00000096, 0x0000002d, 0x00000025, 0x000300f7, 0x00000030,
|
||||
0x00000000, 0x000400fa, 0x0000002e, 0x0000002f, 0x00000030, 0x000200f8, 0x0000002f, 0x000200f9,
|
||||
0x00000095, 0x000200f8, 0x00000030, 0x0004003d, 0x00000035, 0x00000038, 0x00000037, 0x00040064,
|
||||
0x00000034, 0x0000003b, 0x00000038, 0x0007005f, 0x00000018, 0x0000003c, 0x0000003b, 0x00000011,
|
||||
0x00000002, 0x0000003a, 0x00050051, 0x00000017, 0x0000003d, 0x0000003c, 0x00000000, 0x0004006f,
|
||||
0x0000001a, 0x00000041, 0x00000011, 0x00050081, 0x0000001a, 0x00000044, 0x00000041, 0x000000a4,
|
||||
0x00050041, 0x00000046, 0x00000047, 0x0000001d, 0x00000045, 0x0004003d, 0x0000001a, 0x00000048,
|
||||
0x00000047, 0x00050083, 0x0000001a, 0x00000049, 0x00000044, 0x00000048, 0x00050051, 0x00000017,
|
||||
0x0000004d, 0x00000049, 0x00000000, 0x00050088, 0x00000017, 0x00000050, 0x0000004d, 0x00000021,
|
||||
0x00050085, 0x00000017, 0x00000052, 0x00000050, 0x00000051, 0x00050083, 0x00000017, 0x00000054,
|
||||
0x00000052, 0x00000053, 0x00050051, 0x00000017, 0x00000056, 0x00000049, 0x00000001, 0x00060041,
|
||||
0x0000001f, 0x00000057, 0x0000001d, 0x0000001e, 0x00000027, 0x0004003d, 0x00000017, 0x00000058,
|
||||
0x00000057, 0x00050088, 0x00000017, 0x00000059, 0x00000056, 0x00000058, 0x00050085, 0x00000017,
|
||||
0x0000005a, 0x00000059, 0x00000051, 0x00050083, 0x00000017, 0x0000005b, 0x00000053, 0x0000005a,
|
||||
0x00050085, 0x00000017, 0x0000005d, 0x0000003d, 0x00000051, 0x00050083, 0x00000017, 0x0000005e,
|
||||
0x0000005d, 0x00000053, 0x00070050, 0x00000018, 0x0000005f, 0x00000054, 0x0000005b, 0x0000005e,
|
||||
0x00000053, 0x00050041, 0x00000061, 0x00000062, 0x0000001d, 0x0000003a, 0x0004003d, 0x00000019,
|
||||
0x00000063, 0x00000062, 0x00050091, 0x00000018, 0x00000065, 0x00000063, 0x0000005f, 0x00050051,
|
||||
0x00000017, 0x0000006b, 0x00000065, 0x00000003, 0x000500ba, 0x00000012, 0x0000006d, 0x0000006b,
|
||||
0x0000006c, 0x000300f7, 0x0000006f, 0x00000000, 0x000400fa, 0x0000006d, 0x0000006e, 0x0000006f,
|
||||
0x000200f8, 0x0000006e, 0x0007004f, 0x0000001a, 0x00000072, 0x00000065, 0x00000065, 0x00000000,
|
||||
0x00000001, 0x00050050, 0x0000001a, 0x00000075, 0x0000006b, 0x0000006b, 0x00050088, 0x0000001a,
|
||||
0x00000076, 0x00000072, 0x00000075, 0x00050051, 0x00000017, 0x00000079, 0x00000076, 0x00000000,
|
||||
0x00050085, 0x00000017, 0x0000007a, 0x00000079, 0x00000042, 0x00050081, 0x00000017, 0x0000007b,
|
||||
0x0000007a, 0x00000042, 0x00050085, 0x00000017, 0x0000007e, 0x0000007b, 0x00000021, 0x00050051,
|
||||
0x00000017, 0x00000080, 0x00000076, 0x00000001, 0x00050085, 0x00000017, 0x00000081, 0x00000080,
|
||||
0x00000042, 0x00050083, 0x00000017, 0x00000082, 0x00000042, 0x00000081, 0x00050085, 0x00000017,
|
||||
0x00000085, 0x00000082, 0x00000058, 0x00050050, 0x0000001a, 0x00000086, 0x0000007e, 0x00000085,
|
||||
0x00050083, 0x0000001a, 0x00000089, 0x00000086, 0x00000049, 0x000200f9, 0x0000006f, 0x000200f8,
|
||||
0x0000006f, 0x000700f5, 0x0000001a, 0x000000a3, 0x00000068, 0x00000030, 0x00000089, 0x0000006e,
|
||||
0x0004003d, 0x0000008a, 0x0000008d, 0x0000008c, 0x00050051, 0x00000017, 0x00000090, 0x000000a3,
|
||||
0x00000000, 0x00050051, 0x00000017, 0x00000091, 0x000000a3, 0x00000001, 0x00070050, 0x00000018,
|
||||
0x00000092, 0x00000090, 0x00000091, 0x00000067, 0x00000067, 0x00040063, 0x0000008d, 0x00000011,
|
||||
0x00000092, 0x000200f9, 0x00000095, 0x000200f8, 0x00000095, 0x000100fd, 0x00010038,
|
||||
};
|
||||
@@ -1,40 +1,32 @@
|
||||
#version 450
|
||||
// Camera motion vectors for DLAA (vk_dlaa.c mv_pass): each pixel's depth is taken back to the world through this
|
||||
// frame's view-projection and forward through last frame's; the vector is last frame's window position minus this
|
||||
// frame's, in render pixels, without the jitter (DLSS's default convention). Objects that move on their own get only
|
||||
// the camera's motion.
|
||||
// The camera block is TotK's scene uniform block (bound as c4 in the scene's vertex shaders): vec4 rows 3-6 are the
|
||||
// view-projection, rows of a row-major 4x4 with OpenGL clip depth (-w..w). The replay's viewports have negative
|
||||
// heights, so window y grows downwards from ndc y = +1, and depth is z_ndc * 0.5 + 0.5.
|
||||
// Camera motion vectors for DLAA (vk_dlaa.c mv_pass): each pixel's depth goes through reproj, last frame's
|
||||
// view-projection times the inverse of this frame's (made on the CPU in double precision, so a still camera gives the
|
||||
// identity and no motion); the vector is last frame's window position minus this frame's, in render pixels, without
|
||||
// the jitter (DLSS's default convention). Objects that move on their own get only the camera's motion.
|
||||
// The view-projections are TotK's scene uniform block (bound as c4 in the scene's vertex shaders), vec4 rows 3-6, with
|
||||
// OpenGL clip depth (-w..w). The replay's viewports have negative heights, so window y grows downwards from ndc y = +1,
|
||||
// and depth is z_ndc * 0.5 + 0.5.
|
||||
layout(local_size_x = 8, local_size_y = 8) in;
|
||||
layout(binding = 0) uniform sampler2D depth_tex;
|
||||
layout(binding = 1, rg16f) uniform writeonly image2D mv_out;
|
||||
layout(binding = 2, std140) uniform Cur { vec4 r[16]; } cur;
|
||||
layout(binding = 3, std140) uniform Prev { vec4 r[16]; } prev;
|
||||
layout(push_constant) uniform P {
|
||||
mat4 reproj; // this frame's clip space to last frame's
|
||||
vec2 size; // render size in pixels
|
||||
vec2 jitter; // this frame's jitter, pixels, as the scene was drawn (window x right, y down)
|
||||
} pc;
|
||||
|
||||
mat4 vp(vec4 a, vec4 b, vec4 c, vec4 d) { return transpose(mat4(a, b, c, d)); }
|
||||
|
||||
void main() {
|
||||
ivec2 p = ivec2(gl_GlobalInvocationID.xy);
|
||||
if (p.x >= int(pc.size.x) || p.y >= int(pc.size.y)) return;
|
||||
float d = texelFetch(depth_tex, p, 0).r;
|
||||
vec2 win = vec2(p) + 0.5 - pc.jitter; // where this pixel's surface sits without the jitter
|
||||
vec4 ndc = vec4(win.x / pc.size.x * 2.0 - 1.0, 1.0 - win.y / pc.size.y * 2.0, d * 2.0 - 1.0, 1.0);
|
||||
mat4 c = vp(cur.r[3], cur.r[4], cur.r[5], cur.r[6]);
|
||||
mat4 q = vp(prev.r[3], prev.r[4], prev.r[5], prev.r[6]);
|
||||
vec4 world = inverse(c) * ndc;
|
||||
vec4 clip = pc.reproj * ndc;
|
||||
vec2 mv = vec2(0.0);
|
||||
if (abs(world.w) > 1e-12) {
|
||||
vec4 clip = q * (world / world.w);
|
||||
if (clip.w > 1e-6) {
|
||||
vec2 pn = clip.xy / clip.w;
|
||||
vec2 pwin = vec2((pn.x * 0.5 + 0.5) * pc.size.x, (0.5 - pn.y * 0.5) * pc.size.y);
|
||||
mv = pwin - win;
|
||||
}
|
||||
if (clip.w > 1e-6) {
|
||||
vec2 pn = clip.xy / clip.w;
|
||||
vec2 pwin = vec2((pn.x * 0.5 + 0.5) * pc.size.x, (0.5 - pn.y * 0.5) * pc.size.y);
|
||||
mv = pwin - win;
|
||||
}
|
||||
imageStore(mv_out, p, vec4(mv, 0.0, 0.0));
|
||||
}
|
||||
@@ -255,6 +255,7 @@ void vk_mem_gpu_wrote(const VkMemSpan *sp, uint64_t size);
|
||||
void vk_usnap_begin(const uint64_t *handles, int n, uint64_t fence);
|
||||
void vk_usnap_end(uint64_t fence);
|
||||
int vk_usnap_find(uint64_t addr, uint64_t n, uint64_t align, VkDescriptorBufferInfo *out);
|
||||
const void *vk_usnap_host(uint64_t addr, uint64_t n, uint64_t align); // the copy's bytes; NULL: not copied
|
||||
void vk_usnap_drop(uint64_t addr, uint64_t n); // the replay makes the GPU write [addr, addr+n) of guest memory
|
||||
uint64_t vk_usnap_gen(void); // changes whenever a binding may resolve differently
|
||||
void vk_usnap_shutdown(void); // vk_exec_draw_shutdown: frees the arenas
|
||||
|
||||
+89
-48
@@ -220,6 +220,11 @@ int vk_dlaa_available(void) { return vk_dlaa_wanted() && N.available; }
|
||||
// with no depth, and the HUD is drawn over that target at the output size. DLSS runs at the begin of that pass: it
|
||||
// reads the light target and its result is blitted into the pass's target, whose scaling draw is then skipped. The
|
||||
// HUD, drawn afterwards into the same target, is never jittered nor passed through DLSS.
|
||||
// The scaling draw is not always that FXAA shader: at a 1280x720 scene and 1920x1080 output (1.4.3, dlss = quality)
|
||||
// the game's tonemap (guest fs 7e114c4330dc212a) reads the light target and writes the output-sized target itself,
|
||||
// over DLSS's picture, so the jittered scene reached the screen and the whole picture shook. So from DLSS's evaluation
|
||||
// to the frame's end, draws in passes larger than the light target sample DLSS's output in its place
|
||||
// (vk_dlaa_swap_img, applied by vk_exec_draw.c tex_info): whichever shader scales, it scales DLSS's picture.
|
||||
static struct {
|
||||
VkExecTarget color, depth; // the armed pair, valid in the frame it was armed
|
||||
int armed, done, gbuf; // this frame: armed on the light target, DLAA ran, the G-buffer was drawn
|
||||
@@ -245,9 +250,8 @@ static struct {
|
||||
uint64_t holds;
|
||||
// camera (vk_dlaa_draw) and motion vectors (mv_pass)
|
||||
uint64_t cam_addr; // this frame's scene camera block (c4 of a scene draw's vertex stage), 0: none seen
|
||||
VkBuffer camb; // two 256-byte slots: this frame's block and last frame's
|
||||
VmaAllocation camb_mem;
|
||||
int cam_slot, cam_prev_ok; // the slot this frame writes / the other slot holds last frame's camera
|
||||
double cam_prev[16]; // last frame's view-projection (row-major), valid while cam_prev_ok
|
||||
int cam_prev_ok;
|
||||
VkDescriptorSetLayout mv_dsl;
|
||||
VkPipelineLayout mv_layout;
|
||||
VkPipeline mv_pipe;
|
||||
@@ -256,10 +260,11 @@ static struct {
|
||||
uint64_t mv_frames, mv_none;
|
||||
uint64_t why[3]; // history resets: scene size changed, no camera, scene target changed
|
||||
int on; // the dlaa setting, read at each present (the menu switches it live)
|
||||
int scaler_skipped; // this frame: the game's scaling draw over DLSS's picture was skipped
|
||||
uint64_t scaler_missed; // frames DLSS scaled whose scaling draw was not found (vk_dlaa_skip_draw)
|
||||
} D = {.mv_ok = -1};
|
||||
|
||||
const VkTexImage *vk_dlaa_swap_img;
|
||||
VkImageView vk_dlaa_swap_view;
|
||||
|
||||
static int dl_active(void) { return N.available && !D.failed && D.on; }
|
||||
|
||||
static void dl_fail(const char *what, NgxResult r) {
|
||||
@@ -352,25 +357,53 @@ static NgxResourceVK res_image(VkImageView v, VkImage img, VkFormat f, uint32_t
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- motion vectors
|
||||
// Camera motion only (runtime/shaders/dlaa_mv.comp): this frame's scene camera block is copied out of the replay's
|
||||
// uniform snapshot (vk_usnap.c, as of the submit call) into one slot of camb, last frame's stays in the other, and the
|
||||
// compute pass reprojects every pixel's depth through both. Characters and anything else that moves on its own get
|
||||
// the camera's motion only, which DLSS mostly copes with by rejecting their history.
|
||||
// Camera motion only (runtime/shaders/dlaa_mv.comp): this frame's scene camera block is read from the replay's uniform
|
||||
// snapshot (vk_usnap.c, as of the submit call), and the compute pass takes every pixel through last frame's
|
||||
// view-projection times the inverse of this frame's. That matrix is made here in double precision: the shader once
|
||||
// inverted the view-projection itself in 32-bit floats, and the rounding gave a still camera a few hundredths of a
|
||||
// pixel of motion that changed with every jitter step, which DLSS followed, so the whole picture wobbled. Characters
|
||||
// and anything else that moves on its own get the camera's motion only, which DLSS mostly copes with by rejecting
|
||||
// their history.
|
||||
#define CAM_BYTES 256u // vec4 rows 0-15: view, view-projection (3-6), projection, inverse view
|
||||
|
||||
// m inverted in place (row-major 4x4, Gauss-Jordan with partial pivoting). 0: singular.
|
||||
static int invert4(double m[16]) {
|
||||
double a[4][8];
|
||||
for (int r = 0; r < 4; r++)
|
||||
for (int c = 0; c < 8; c++) a[r][c] = c < 4 ? m[r * 4 + c] : (c - 4 == r);
|
||||
for (int c = 0; c < 4; c++) {
|
||||
int p = c;
|
||||
for (int r = c + 1; r < 4; r++)
|
||||
if (fabs(a[r][c]) > fabs(a[p][c])) p = r;
|
||||
if (fabs(a[p][c]) < 1e-30) return 0;
|
||||
for (int k = 0; k < 8; k++) {
|
||||
double t = a[c][k];
|
||||
a[c][k] = a[p][k], a[p][k] = t;
|
||||
}
|
||||
double inv = 1.0 / a[c][c];
|
||||
for (int k = 0; k < 8; k++) a[c][k] *= inv;
|
||||
for (int r = 0; r < 4; r++) {
|
||||
if (r == c || a[r][c] == 0.0) continue;
|
||||
double f = a[r][c];
|
||||
for (int k = 0; k < 8; k++) a[r][k] -= f * a[c][k];
|
||||
}
|
||||
}
|
||||
for (int r = 0; r < 4; r++)
|
||||
for (int c = 0; c < 4; c++) m[r * 4 + c] = a[r][c + 4];
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int mv_init(void) {
|
||||
if (D.mv_ok >= 0) return D.mv_ok;
|
||||
D.mv_ok = 0;
|
||||
const VkCtx *c = vk_ctx();
|
||||
VkDescriptorSetLayoutBinding b[4] = {
|
||||
VkDescriptorSetLayoutBinding b[2] = {
|
||||
{0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_COMPUTE_BIT, NULL},
|
||||
{1, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1, VK_SHADER_STAGE_COMPUTE_BIT, NULL},
|
||||
{2, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT, NULL},
|
||||
{3, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT, NULL}};
|
||||
{1, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1, VK_SHADER_STAGE_COMPUTE_BIT, NULL}};
|
||||
VkDescriptorSetLayoutCreateInfo dci = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
|
||||
.flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
|
||||
.bindingCount = 4, .pBindings = b};
|
||||
VkPushConstantRange pr = {VK_SHADER_STAGE_COMPUTE_BIT, 0, 16};
|
||||
.bindingCount = 2, .pBindings = b};
|
||||
VkPushConstantRange pr = {VK_SHADER_STAGE_COMPUTE_BIT, 0, 80};
|
||||
VkSamplerCreateInfo si = {.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, .magFilter = VK_FILTER_NEAREST,
|
||||
.minFilter = VK_FILTER_NEAREST, .mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST,
|
||||
.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
|
||||
@@ -379,16 +412,12 @@ static int mv_init(void) {
|
||||
VkShaderModuleCreateInfo mi = {.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, .codeSize = sizeof dlaa_mv_spv,
|
||||
.pCode = dlaa_mv_spv};
|
||||
VkShaderModule m = VK_NULL_HANDLE;
|
||||
VkBufferCreateInfo bi = {.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, .size = 2 * CAM_BYTES,
|
||||
.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT};
|
||||
VmaAllocationCreateInfo ai = {.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE};
|
||||
if (vkCreateDescriptorSetLayout(c->device, &dci, NULL, &D.mv_dsl) != VK_SUCCESS) goto fail;
|
||||
VkPipelineLayoutCreateInfo li = {.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, .setLayoutCount = 1,
|
||||
.pSetLayouts = &D.mv_dsl, .pushConstantRangeCount = 1, .pPushConstantRanges = &pr};
|
||||
if (vkCreatePipelineLayout(c->device, &li, NULL, &D.mv_layout) != VK_SUCCESS ||
|
||||
vkCreateSampler(c->device, &si, NULL, &D.mv_samp) != VK_SUCCESS ||
|
||||
vkCreateShaderModule(c->device, &mi, NULL, &m) != VK_SUCCESS ||
|
||||
vmaCreateBuffer(c->vma, &bi, &ai, &D.camb, &D.camb_mem, NULL) != VK_SUCCESS)
|
||||
vkCreateShaderModule(c->device, &mi, NULL, &m) != VK_SUCCESS)
|
||||
goto fail;
|
||||
VkComputePipelineCreateInfo ci = {.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
|
||||
.stage = {.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
|
||||
@@ -407,34 +436,37 @@ fail:
|
||||
// zero and DLSS starts a new history).
|
||||
static int mv_pass(VkCommandBuffer cb, const struct Size *e, VkImageView zv, float jx, float jy) {
|
||||
uint32_t w = e->w, h = e->h;
|
||||
VkDescriptorBufferInfo cam;
|
||||
if (!mv_init() || !D.cam_addr || !vk_usnap_find(D.cam_addr, CAM_BYTES, 4, &cam)) {
|
||||
const float *cam = D.cam_addr ? vk_usnap_host(D.cam_addr, CAM_BYTES, 4) : NULL;
|
||||
if (!mv_init() || !cam) {
|
||||
D.mv_none++;
|
||||
D.cam_prev_ok = 0;
|
||||
return 0;
|
||||
}
|
||||
int s = D.cam_slot, had_prev = D.cam_prev_ok;
|
||||
VkBufferCopy bc = {cam.offset, (VkDeviceSize)s * CAM_BYTES, CAM_BYTES};
|
||||
vkCmdCopyBuffer(cb, cam.buffer, D.camb, 1, &bc);
|
||||
full_barrier(cb);
|
||||
D.cam_slot ^= 1, D.cam_prev_ok = 1;
|
||||
if (!had_prev) return 0; // nothing to reproject into: zero motion, new history
|
||||
double cur[16], prev[16], m[16];
|
||||
for (int i = 0; i < 16; i++) cur[i] = cam[12 + i]; // rows 3-6
|
||||
int had_prev = D.cam_prev_ok;
|
||||
memcpy(prev, D.cam_prev, sizeof prev);
|
||||
memcpy(D.cam_prev, cur, sizeof cur), D.cam_prev_ok = 1;
|
||||
if (!had_prev || !invert4(cur)) return 0; // nothing to reproject into: zero motion, new history
|
||||
for (int r = 0; r < 4; r++)
|
||||
for (int c = 0; c < 4; c++) {
|
||||
double v = 0;
|
||||
for (int k = 0; k < 4; k++) v += prev[r * 4 + k] * cur[k * 4 + c];
|
||||
m[r * 4 + c] = v;
|
||||
}
|
||||
VkDescriptorImageInfo zi = {D.mv_samp, zv, VK_IMAGE_LAYOUT_GENERAL};
|
||||
VkDescriptorImageInfo oi = {VK_NULL_HANDLE, e->mv_view, VK_IMAGE_LAYOUT_GENERAL};
|
||||
VkDescriptorBufferInfo cur = {D.camb, (VkDeviceSize)s * CAM_BYTES, CAM_BYTES};
|
||||
VkDescriptorBufferInfo prev = {D.camb, (VkDeviceSize)(s ^ 1) * CAM_BYTES, CAM_BYTES};
|
||||
VkWriteDescriptorSet wr[4] = {
|
||||
VkWriteDescriptorSet wr[2] = {
|
||||
{.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, .dstBinding = 0, .descriptorCount = 1,
|
||||
.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, .pImageInfo = &zi},
|
||||
{.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, .dstBinding = 1, .descriptorCount = 1,
|
||||
.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, .pImageInfo = &oi},
|
||||
{.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, .dstBinding = 2, .descriptorCount = 1,
|
||||
.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, .pBufferInfo = &cur},
|
||||
{.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, .dstBinding = 3, .descriptorCount = 1,
|
||||
.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, .pBufferInfo = &prev}};
|
||||
.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, .pImageInfo = &oi}};
|
||||
vkCmdBindPipeline(cb, VK_PIPELINE_BIND_POINT_COMPUTE, D.mv_pipe);
|
||||
rec_push(vk_pipeline_push_fn(), cb, VK_PIPELINE_BIND_POINT_COMPUTE, D.mv_layout, 0, 4, wr);
|
||||
float pc[4] = {(float)w, (float)h, jx, jy};
|
||||
rec_push(vk_pipeline_push_fn(), cb, VK_PIPELINE_BIND_POINT_COMPUTE, D.mv_layout, 0, 2, wr);
|
||||
float pc[20];
|
||||
for (int r = 0; r < 4; r++)
|
||||
for (int c = 0; c < 4; c++) pc[c * 4 + r] = (float)m[r * 4 + c]; // GLSL mat4 is column-major
|
||||
pc[16] = (float)w, pc[17] = (float)h, pc[18] = jx, pc[19] = jy;
|
||||
vkCmdPushConstants(cb, D.mv_layout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof pc, pc);
|
||||
vkCmdDispatch(cb, (w + 7) / 8, (h + 7) / 8, 1);
|
||||
full_barrier(cb);
|
||||
@@ -563,6 +595,7 @@ static void evaluate(VkExec *ex, const VkExecTarget *dst) {
|
||||
.dstOffsets = {{0, 0, 0}, {(int32_t)ow, (int32_t)oh, 1}}};
|
||||
vkCmdBlitImage(cb, e->out, VK_IMAGE_LAYOUT_GENERAL, dst->image, VK_IMAGE_LAYOUT_GENERAL, 1, &b, VK_FILTER_NEAREST);
|
||||
full_barrier(cb);
|
||||
if (dst != t) vk_dlaa_swap_img = t->img, vk_dlaa_swap_view = e->out_view; // the scaling draw reads DLSS's picture
|
||||
ex->recorded += 4;
|
||||
vk_exec_draw_new_cb(); // NGX bound pipelines and descriptor sets of its own: the next draw binds everything again
|
||||
D.jdepth = z->image;
|
||||
@@ -589,9 +622,13 @@ void vk_dlaa_pass(VkExec *ex) {
|
||||
D.gbuf = 1, D.armed = 0;
|
||||
return;
|
||||
}
|
||||
// the scene depth is D32F; a D16 target of the scene size also serves one composite pass before the transparents
|
||||
// the scene depth is D32F; a D16 target of the scene size also serves one composite pass before the transparents.
|
||||
// A smaller pair never takes over an armed one: the camera rune draws a half-size RGBA16F target with a half-size
|
||||
// D32F depth after the lighting (852x480 under a 1704x960 scene), and DLSS ran on that and wrote its picture into
|
||||
// the scene's own light target, which left every object black.
|
||||
if (D.gbuf && ex->pass_ncolor == 1 && c->image && scene_color(c->format) && z->image && z->format == VK_FORMAT_D32_SFLOAT &&
|
||||
c->width == z->width && c->height == z->height && c->width >= 640 &&
|
||||
(!D.armed || (c->width >= D.color.width && c->height >= D.color.height)) &&
|
||||
c->samples <= 1 && !c->is3d) {
|
||||
D.color = *c, D.depth = *z, D.armed = 1;
|
||||
return;
|
||||
@@ -605,15 +642,18 @@ void vk_dlaa_pass(VkExec *ex) {
|
||||
if (D.color.width >= o[0]) D.done = 1, evaluate(ex, NULL); // DLAA in place; else wait for the scaling pass
|
||||
return;
|
||||
}
|
||||
// the game's scaling pass: one colour target wider than the scene, no depth
|
||||
// the game's scaling pass: one colour target of the output size, no depth
|
||||
unsigned o[2], s[2];
|
||||
res_sizes(o, s);
|
||||
if (ex->pass_ncolor == 1 && c->image && !z->image && scene_color(c->format) && c->width > D.color.width &&
|
||||
c->samples <= 1 && !c->is3d) {
|
||||
c->width == o[0] && c->height == o[1] && c->samples <= 1 && !c->is3d) {
|
||||
D.done = D.up = 1;
|
||||
evaluate(ex, c);
|
||||
}
|
||||
}
|
||||
|
||||
void vk_dlaa_frame(void) {
|
||||
vk_dlaa_swap_img = NULL, vk_dlaa_swap_view = VK_NULL_HANDLE;
|
||||
int on = N.available && cfg_bool("TOTK_DLAA");
|
||||
if (on != D.on) {
|
||||
rt_log("dlaa: %s", on ? "on" : "off");
|
||||
@@ -628,10 +668,7 @@ void vk_dlaa_frame(void) {
|
||||
if (D.jit_used && !D.done) D.hold = 60, D.holds++; // jittered but not resolved: that frame shook
|
||||
else if (D.hold) D.hold--;
|
||||
if (!D.done) D.jit_ok = 0;
|
||||
if (D.up && !D.scaler_skipped && ++D.scaler_missed == 1)
|
||||
rt_log("dlaa: the game's scaling draw over DLSS's picture was not found (its fragment shader is not in FXAA_FS): "
|
||||
"the jittered scene reaches the screen and shakes");
|
||||
D.armed = D.done = D.jit_used = D.gbuf = D.ended = D.up = D.scaler_skipped = 0;
|
||||
D.armed = D.done = D.jit_used = D.gbuf = D.ended = D.up = 0;
|
||||
D.cam_addr = 0;
|
||||
}
|
||||
|
||||
@@ -646,8 +683,8 @@ void vk_dlaa_frame(void) {
|
||||
// is always drawn, whatever fxaa says (skipping it would leave the 3D picture out), unless DLSS already wrote that
|
||||
// target this frame.
|
||||
// The stock translator's hash, the one with tools/xlate patch 0010 (PCSS, PR #89) applied, and the one with patches
|
||||
// 0010 and 0011 (the shadow filter spread) applied. A translator change that gives the shader another hash is reported
|
||||
// by vk_dlaa_frame: the game's scaling draw then covers DLSS's picture with the jittered scene, which shakes.
|
||||
// 0010 and 0011 (the shadow filter spread) applied. A scaling draw this list misses still scales DLSS's picture, not
|
||||
// the jittered scene: after DLSS ran, passes larger than the light target sample DLSS's output (vk_dlaa_swap_img).
|
||||
static const uint64_t FXAA_FS[] = {0xf450003ebeb3dc52ull, 0x0a12f4bc2a9a4fbeull, 0x5c43ae18948d52cbull};
|
||||
|
||||
static uint64_t spirv_hash(const GfxShader *s) {
|
||||
@@ -688,7 +725,7 @@ int vk_dlaa_skip_draw(VkExec *ex, const GfxShader *fs) {
|
||||
int known = 0;
|
||||
for (size_t i = 0; i < sizeof FXAA_FS / sizeof FXAA_FS[0]; i++) known |= h == FXAA_FS[i];
|
||||
if (!known) return 0;
|
||||
if (!ex->depth.image) return D.scaler_skipped = D.up; // the scaling pass
|
||||
if (!ex->depth.image) return D.up; // the scaling pass, which DLSS replaced
|
||||
if (!fxaa && !fx_found) {
|
||||
fx_found = 1;
|
||||
rt_log("dlaa: fxaa = 0 skips the game's FXAA (fragment shader %016llx)", (unsigned long long)h);
|
||||
@@ -699,6 +736,10 @@ int vk_dlaa_skip_draw(VkExec *ex, const GfxShader *fs) {
|
||||
#else
|
||||
// NGX is loaded as a Windows DLL; elsewhere DLAA, the DLSS modes' scaling and the FXAA switch do nothing.
|
||||
#include "vk_dlaa.h"
|
||||
#include "vk_exec.h"
|
||||
|
||||
const VkTexImage *vk_dlaa_swap_img;
|
||||
VkImageView vk_dlaa_swap_view;
|
||||
|
||||
int vk_dlaa_wanted(void) { return 0; }
|
||||
void vk_dlaa_instance_exts(const char **ext, uint32_t *n, uint32_t max) { (void)ext, (void)n, (void)max; }
|
||||
|
||||
@@ -188,6 +188,10 @@ VkImageView vk_exec_target_view(const VkTexImage *img, VkFormat format, VkImageV
|
||||
// vk_exec_xfer.c: OP_COPY_B2B, OP_COPY_B2T, OP_COPY_T2B, OP_COPY_T2T, OP_CLEAR_TEX, OP_SIGNAL_EVENT, OP_REPORT_COUNTER,
|
||||
// OP_RESET_COUNTER, OP_RENDER_ENABLE, OP_RENDER_COND, OP_CLEAR_BUF.
|
||||
void vk_exec_op_xfer(VkExec *ex, uint32_t op, const void *payload);
|
||||
// vk_dlaa.c: once DLSS has scaled the scene this frame, passes larger than the scene's light target vk_dlaa_swap_img
|
||||
// sample DLSS's output vk_dlaa_swap_view in its place, so the game's scaling draw scales DLSS's picture.
|
||||
extern const VkTexImage *vk_dlaa_swap_img;
|
||||
extern VkImageView vk_dlaa_swap_view;
|
||||
// vk_contact.c: a pass about to begin (its targets resolved, no pass open), and a dispatch or copy about to be recorded
|
||||
void vk_contact_pass_begin(VkExec *ex);
|
||||
void vk_contact_flush(VkExec *ex);
|
||||
|
||||
@@ -1398,9 +1398,13 @@ static Twin *twin_update(VkExec *ex, const VkTexImage *img) {
|
||||
}
|
||||
|
||||
// The image descriptor of slot h; in a dispatch, a compare-sampled colour image the driver cannot compare is swapped
|
||||
// for its depth twin.
|
||||
// for its depth twin; in a pass larger than it, the scene's light target, once DLSS scaled it this frame, for DLSS's
|
||||
// output (vk_dlaa.c).
|
||||
static void tex_info(VkExec *ex, const GfxShaderRes *r, uint64_t h, int storage, int separate, VkDescriptorImageInfo *out) {
|
||||
tex_info_lookup(ex, r, h, storage, separate, out);
|
||||
if (h && !storage && vk_dlaa_swap_img && ex->in_pass && ex->pass_w > vk_dlaa_swap_img->width + 1 &&
|
||||
vk_texture_by_id_locked((int)(h & 0xfffff), NULL, NULL) == vk_dlaa_swap_img)
|
||||
out->imageView = vk_dlaa_swap_view, out->imageLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
if (!twin_dispatch || storage || separate || !h || !(r->type & 0x400)) return;
|
||||
VkImageViewType vt = res_view_type(r->type);
|
||||
if (vt != VK_IMAGE_VIEW_TYPE_2D && vt != VK_IMAGE_VIEW_TYPE_2D_ARRAY) return;
|
||||
|
||||
@@ -290,6 +290,12 @@ int vk_usnap_find(uint64_t addr, uint64_t n, uint64_t align, VkDescriptorBufferI
|
||||
return 1;
|
||||
}
|
||||
|
||||
const void *vk_usnap_host(uint64_t addr, uint64_t n, uint64_t align) {
|
||||
VkDescriptorBufferInfo b;
|
||||
if (!vk_usnap_find(addr, n, align, &b)) return NULL;
|
||||
return U.arena->map + b.offset;
|
||||
}
|
||||
|
||||
void vk_usnap_drop(uint64_t addr, uint64_t n) {
|
||||
if (!U.mode || !n) return;
|
||||
if (U.nwr == U.cwr) U.wr = grow(U.wr, &U.cwr, sizeof *U.wr);
|
||||
|
||||
Reference in new issue
Block a user