Repository navigation
REFACTOR-SGT-308: split the three largest renderer files by theme - #241
Merged
Merged
Conversation
vk_rasterizer_native.cpp (29,203 lines), vk_pipeline_cache.cpp (12,143) and vk_rasterizer.cpp (7,458) are split into themed files beside them, generated from anchors on function signatures so the split can be redone after a rebase. Pure move: no renames, reordering or reformatting; class definitions stay where they were and #if/NDEBUG/SHADGT_DIAGNOSTICS gating is kept. - vk_rasterizer_native.cpp: main 1,393 lines + 19 parts (images, passes, writebacks, regions, one_offs, guest_buffers, targets, probes, bindings, vertices, sync, draw, temporal, prepared, dispatch, memory, eviction, present, reports) + vk_rasterizer_native_internal.h. - vk_pipeline_cache.cpp: main 210 + 14 parts (runtime_info, manifest, driver_cache, builds, replay, waits, lookup, keys, stored, prewarm, modules, translation, programs, retention) + vk_pipeline_cache_internal.h. - vk_rasterizer.cpp: main 67 + 10 parts (ahead, pipelines, diagnostics, draw, fences, frame_dump, buffers, textures, rendering, state) + vk_rasterizer_internal.h. File-local helpers that several parts use moved to the private headers: the anonymous namespace becomes an inline namespace (<File>Shared) and static becomes inline (158, 75 and 40 changed lines), so every variable and function-local static, the SHADGT_ env reads included, still has one instance. Helpers with one user moved into that part. Out-of-class nested type definitions are in the headers; external definitions that sat in shared blocks stay in one .cpp under the same #if chain. Renderer tests: the source extractors read a generated concatenation of the native files (concat_sources.py); three take items by name (native_items.py) since their spans now cross files; compute_policy reads vk_rasterizer_ahead.cpp. Checked: Release and RelWithDebInfo build and link ryty_gpu; every file syntax-checks with SHADGT_DIAGNOSTICS=1, and the pipeline cache and rasterizer parts with the shadps4 target's flags (not linked). The same SHADGT_ literals are in both binaries (327 Release, 376 RelWithDebInfo); no symbol is defined twice; the renderer tests pass and fail as before (44/18); tools/switch_prefix.py gives the same map. GT7 (Release, RTX, PS4 Pro mode) precompiled, loaded and finished a race with no renderer errors. Not measured: frame time. The PGO profile no longer matches the moved file-local functions (~1.8% of native's profile weight), so regenerate renderer/pgo/renderer.profdata or A/B before relying on numbers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
development changed vk_pipeline_cache.cpp and vk_rasterizer_native.cpp, which this branch splits into parts. Each of those hunks is moved to the part that now holds its code: PERF-SGT-307 into vk_pipeline_cache_prewarm, FIX-SGT-309 into _builds, _prewarm and the private header, FIX-SGT-314 into the native main file, _passes, _one_offs, _draw and _dispatch, DIAG-SGT-313 into _draw (its helpers there, their one user), PERF-SGT-302 into _sync and FIX-SGT-315 into _present. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX-SGT-331's vk_pipeline_cache.cpp hunk moves to vk_pipeline_cache_prewarm.cpp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Development's FIX-SGT-314 defined NativeRenderer::OcclusionScope beside its passes code, but the draw part issues it: as the other out-of-class nested types, its definition moves to vk_rasterizer_native_internal.h. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vk_rasterizer_native.cpp (29,203 lines), vk_pipeline_cache.cpp (12,143)
and vk_rasterizer.cpp (7,458) are split into themed files beside them,
generated from anchors on function signatures so the split can be redone
after a rebase. Pure move: no renames, reordering or reformatting; class
definitions stay where they were and #if/NDEBUG/SHADGT_DIAGNOSTICS gating
is kept.
writebacks, regions, one_offs, guest_buffers, targets, probes, bindings,
vertices, sync, draw, temporal, prepared, dispatch, memory, eviction,
present, reports) + vk_rasterizer_native_internal.h.
driver_cache, builds, replay, waits, lookup, keys, stored, prewarm,
modules, translation, programs, retention) + vk_pipeline_cache_internal.h.
draw, fences, frame_dump, buffers, textures, rendering, state) +
vk_rasterizer_internal.h.
File-local helpers that several parts use moved to the private headers:
the anonymous namespace becomes an inline namespace (Shared) and
static becomes inline (158, 75 and 40 changed lines), so every variable
and function-local static, the SHADGT_ env reads included, still has one
instance. Helpers with one user moved into that part. Out-of-class nested
type definitions are in the headers; external definitions that sat in
shared blocks stay in one .cpp under the same #if chain.
Renderer tests: the source extractors read a generated concatenation of
the native files (concat_sources.py); three take items by name
(native_items.py) since their spans now cross files; compute_policy reads
vk_rasterizer_ahead.cpp.
Checked: Release and RelWithDebInfo build and link ryty_gpu; every file
syntax-checks with SHADGT_DIAGNOSTICS=1, and the pipeline cache and
rasterizer parts with the shadps4 target's flags (not linked). The same
SHADGT_ literals are in both binaries (327 Release, 376 RelWithDebInfo);
no symbol is defined twice; the renderer tests pass and fail as before
(44/18); tools/switch_prefix.py gives the same map. GT7 (Release, RTX,
PS4 Pro mode) precompiled, loaded and finished a race with no renderer
errors.
Not measured: frame time. The PGO profile no longer matches the moved
file-local functions (~1.8% of native's profile weight), so regenerate
renderer/pgo/renderer.profdata or A/B before relying on numbers.
🤖 Generated with Claude Code