feat(vk): the renderer's switches in one table (gpu/vk/switches.def), and a start that says which are set #1300
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1300
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/switch-table"
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?
Type: feat · Risk: low · Tested on: Linux, RTX 3090 · Needs: Windows, any GPU (the report reads the environment through
_environthere)Depends on #1288 (M0 of the renderer rework plan): this branch is stacked on it. Review the last commit.
Why
The renderer reads 571 switches from the environment, each where it is used, and nothing lists them: 126 have a row in
docs/development.md. So nobody can say which ones still matter, which only turn an old path back on, and which decide something by the GPU. A switch set with a misspelt name, or one that was removed, does nothing and says nothing, and a bug report's log doesn't show how far the run was from the defaults. This is the plan's M2: one table of the switches, as the base for removing most of them and for deciding the per-GPU defaults in one place.What changed
Every
RX_switch now has a row in one table, a check holds the table and the source to each other, and the renderer says at its start which switches the run has set. No switch changes what it does, except one second name that is removed.gpu/vk/switches.def, one row a switch: its name, its kind, what the renderer does with it unset, and what setting it does. The kinds (gpu/vk/switches.h):diag189,kill177 (turns off something that is on for everyone),tune73,attempt57 (turns on something nobody ships),hw49 (unset, it follows the PC),player26. The rows were written from a reading of each switch's code; where a row and the code disagree the code is right.switches::reportingpu/vk/switches.h, called fromstart()ingpu/vk/vk_main.cpp. One line names every switch set with its value and kind; a value that is a path is said as<a path>. EachRX_name set that is no switch gets a line: a removed one with what became of it, another as misspelt or from another build.GONE(name, date, what became of it)row. The nineRX_names ofremoved_switch_notes()inhost/hos_main.cmoved there (the host keeps its ownHOS_ones), andRX_VK_GPU_PROFILE, a second name forRX_VK_PASS_TIMING=1, is removed (gpu/vk/vk_gprof.cpp).RX_DUMP_WGSL,RX_DUMP_SLOW_WGSL,RX_DUMP_TICS,RX_WGSL_OVERRIDE) leave the list of nameslongshot_env.txtmay not set (host/hos_main.c).tests/test_switch_table.pyfails on a name the source reads without a row, a row nothing reads, a removed name still read, and a table out of order; it compilesswitches.halone and runs the report on made-up environments.docs/development.md(Switches for testing and debugging) andAGENTS.md: a new switch needs a row.The reads stay at their sites: the plan's M2 said "no file but the table's reads the environment", and this PR holds each read to the table by a check instead, so the four large renderer files are not touched while 77 pull requests are open against them.
Measurements
Verdict: nothing to gain in speed, and none lost: the report runs once at the start. One session of this PR's build ran Kokiri Forest and Hyrule Field at the frame rates
mainhad in the same day's sessions (Hyrule Field standing 79.5 fps here, 78.9 and 77.5 onmain; Kokiri Forest standing 56.5, 55.5 and 55.0). That is one run, so it shows nothing broke, not a comparison.(Those lines are from the commit before the last edit, which now prints a path as
<a path>; the home folder's name is cut here by hand.)Flags and settings
One switch removed, none added.
RX_VK_GPU_PROFILERX_VK_PASS_TIMING=1RX_VK_PASS_TIMING=1Testing
Tested: Linux, RTX 3090 (NVIDIA 620.70), a dev pack over base
8e9cfc3a: the game from the Kokiri Forest save, then Hyrule Field by the debug teleport, standing and turning in each, 2560x1440; withRX_VK_GPU_PROFILE=1,RX_VK_OOT_FOG=1,RX_VK_NOT_A_SWITCH=1andRX_VK_DESC_REUSE=1set. The four lines above came out, the scenes drew, and the run ended cleanly. The last edit (a path's value) was built but not run in the game.Not tested: Windows.
tests/test_switch_table.pywas not run on this PC (no checks are run here); the forge's checks run it. The rows' texts were not each checked against the code by a second reader: 571 rows, read once.Must be tested:
RX_VK_DRAW_STATS=1set, expectingvk: switches set (1): RX_VK_DRAW_STATS=1 (diag)inlongshot_log.txt(Test Farm:@Beanstalk windows, a start with RX_VK_DRAW_STATS=1 set and the log's "switches set" line)Risks
What could break: a start on Windows where
_environis not filled (the report then says none are set; nothing else reads it). A pull request that adds a switch now failstests/test_switch_table.pyuntil it adds a row.Turning it off: revert the commit
Compatibility: a run that set
RX_VK_GPU_PROFILE=1no longer gets the GPU profile and is told to setRX_VK_PASS_TIMING=1. Nothing else changes.Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). Not run on this PC; left to the forge's checks.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.🤖 Generated with Claude Code
Tested in game: RTX 3090, NVIDIA 620.70, Linux: a dev pack over base
8e9cfc3afrom the Kokiri Forest save, then Hyrule Field by the debug teleport, standing and turning in each at 2560x1440, with RX_VK_GPU_PROFILE=1, RX_VK_OOT_FOG=1, RX_VK_NOT_A_SWITCH=1 and RX_VK_DESC_REUSE=1 set. The start logged the removed, the misspelt and the set switches, both scenes drew at main's frame rates (Hyrule Field standing 79.5 fps), and the run ended cleanly. The last edit (a path's value said as ) was built, not run.WIP: feat(vk): the renderer's switches in one table (gpu/vk/switches.def), and a start that says which are setto feat(vk): the renderer's switches in one table (gpu/vk/switches.def), and a start that says which are setHumanBean referenced this pull request2026-11-17 03:56:33 +00:00