Skip to content

REFACTOR-SGT-308: split the three largest renderer files by theme - #241

Merged
xacidr4inx merged 5 commits into
developmentfrom
refactor/sgt-308-split-large-files
Dec 6, 2026
Merged

xacidr4inx merged 5 commits into
developmentfrom
refactor/sgt-308-split-large-files

Conversation

@xacidr4inx

Copy link
Copy Markdown
Collaborator

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 (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

xacidr4inx and others added 5 commits December 4, 2026 10:50
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>
@xacidr4inx
xacidr4inx merged commit 9b74eb8 into development Dec 6, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant