Lighting: classic-sky path as a specialisation constant #818

Open
opened 2026-10-17 18:10:01 +00:00 by sky_line · 0 comments
Owner

atmosClassic() is a runtime test, so both the classic and linear paths of lightSurface's PBR and legacy branches are compiled and registers are allocated for the worst. Specialise it (constants 8-17 mechanism); ao_up.x has the same three-way pattern. Needs measurement: register count of the lighting kernels with one side compiled out.

Context: measured on a GTX 1080 (Pascal) at 4K with the test-control channel and the shader clock (RenderVKShaderClockLighting) / pipeline stats (RenderVKPipelineStats). The frame is GPU-bound but not bandwidth-bound (memory controller ~36% busy on the 1080, ~14% on a 5090): it is latency / occupancy bound, so trading a little memory traffic for fewer registers and fewer dependent loads should help every GPU generation.

atmosClassic() is a runtime test, so both the classic and linear paths of lightSurface's PBR and legacy branches are compiled and registers are allocated for the worst. Specialise it (constants 8-17 mechanism); ao_up.x has the same three-way pattern. Needs measurement: register count of the lighting kernels with one side compiled out. Context: measured on a GTX 1080 (Pascal) at 4K with the test-control channel and the shader clock (RenderVKShaderClockLighting) / pipeline stats (RenderVKPipelineStats). The frame is GPU-bound but not bandwidth-bound (memory controller ~36% busy on the 1080, ~14% on a 5090): it is latency / occupancy bound, so trading a little memory traffic for fewer registers and fewer dependent loads should help every GPU generation.
sky_line added this to the Slipstream project 2026-10-17 18:10:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#818
No description provided.