mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 06:59:57 -04:00
Keep the runtime's shaders in the repository as source only, and compile them when the game is built.
The fifteen headers of SPIR-V words under runtime/ are no longer tracked. tools/build_shaders.py builds all of them: the GLSL with glslc, the SPIR-V assembly with spirv-as, and the two shaders assembled in Python from their scripts. build_game.py builds the missing and the stale ones before it compiles the runtime, and the build kit, the launcher release and the AppImage build them before they copy runtime/, so a player's PC still needs no shader compiler. git ignores the headers and check_content.py refuses a compiled shader in a commit. The headers built this way are byte for byte the ones removed here. vk_mvobj_fs.h is now mvobj_fs_spv.h, named like the others. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Writes runtime/dlaa_mask_spv.h: the SPIR-V of DLSS's reactive mask pass (vk_dlaa.c, mask_pass), assembled here like
|
||||
tools/make_mvobj_fs.py (no GLSL compiler on the machine this was written on).
|
||||
"""The SPIR-V of DLSS's reactive mask pass (vk_dlaa.c, mask_pass) as runtime/dlaa_mask_spv.h, assembled here like
|
||||
tools/make_mvobj_fs.py. tools/build_shaders.py writes the header from HEADER when the game is built; run on its own,
|
||||
this script writes it too.
|
||||
|
||||
The shader, as GLSL:
|
||||
|
||||
@@ -196,8 +197,11 @@ a.op(F, OpFunctionEnd)
|
||||
|
||||
w = a.words()
|
||||
lines = [', '.join(f'0x{x:08x}' for x in w[i:i + 8]) for i in range(0, len(w), 8)]
|
||||
OUT.write_text(
|
||||
HEADER = (
|
||||
'// Generated by tools/make_dlaa_mask.py: DLSS\'s reactive mask pass (vk_dlaa.c mask_pass). Do not edit.\n'
|
||||
'#pragma once\n#include <stdint.h>\n'
|
||||
'static const uint32_t dlaa_mask_spv[] = {\n ' + ',\n '.join(lines) + '\n};\n', newline='\n')
|
||||
print(f'{OUT}: {len(w)} words')
|
||||
'static const uint32_t dlaa_mask_spv[] = {\n ' + ',\n '.join(lines) + '\n};\n')
|
||||
|
||||
if __name__ == '__main__':
|
||||
OUT.write_text(HEADER, newline='\n')
|
||||
print(f'{OUT}: {len(w)} words')
|
||||
|
||||
Reference in New Issue
Block a user