Skip to content

Tidy the Android Vulkan seams: one frame-slot count, one sort key width - #40

Merged
Xget7 merged 4 commits into
mainfrom
fix-android-seams
Oct 20, 2026
Merged

Xget7 merged 4 commits into
mainfrom
fix-android-seams

Conversation

@Xget7

@Xget7 Xget7 commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

Final-review fixes for the Android native layout: the shared rulings plus the Android seams and tidy.

layout/VulkanFrameSlots.h   kFramesInFlight = 2   <- world/ frame/ raster/ cull/ sort/ selection/ presentation/
layout/VulkanSortKeys.h     KeyBits, keyBitCount  <- cull/ sort/ frame/
frame/VulkanFrameCompute    supported(ctx)        <- VulkanSplatRenderer::selectsLodOnGpu()
VulkanSplatRenderer         adoptWorld(world, compute) <- uploadWorld, uploadLodWorld, createSlab
  • One kFramesInFlight replaces VulkanFrameLoop::kFramesInFlight and the kSlots copies in the visibility, sort, LOD selection and frame compute classes. world/, frame/ and raster/ no longer include presentation/ to read it.
  • One KeyBits replaces the two enums in VulkanVisibilityPass.h and VulkanRadixSort.h. The 16 and 32 bit widths are named in the same header.
  • VulkanFrameCompute::supported(ctx) answers what the renderer root asked the visibility pass and radix sort directly.
  • adoptWorld holds the store, policy, bind and completion reset repeated in three upload paths. The waitIdle calls stay in the callers where they were, including uploadLodWorld having none after the upload.
  • ShaderModule is VulkanShaderModule and memoryBarrier is vulkanMemoryBarrier.

Behaviour, shader text and SPIR-V are unchanged. The four-commit history is one change per commit.

Evidence

  • Before: main at 2558fc3; SPIR-V baseline ~/.rn-build-external/layout-baseline-spirv.sha.
  • After: all nine generated .spv hashes equal the baseline, from both the standalone CMake build and the Gradle build. splatkit_*_test (7 targets) and libsplatkit.so build for arm64.
  • Where it ran: no physical device and no emulator ran this. Device runs are deferred to an end session. Built on macOS with NDK 27.1.12297006.
  • Checks: scripts/lint-cpp.sh clean; apps/android-dev ./gradlew :splatkit:assembleRelease :app:assembleRelease :splatkit:testDebugUnitTest succeeds; the host WorldFrameCompletion check from android.yml compiles and exits 0. The native device tests were built, not run. sdk_harness.py, the validation layer, npm run check and npm run lint were skipped: no JS or engine change.

Merge Danger

Door: Two-way.

Blast Radius: Android

Renames and constants inside the Vulkan renderer only. The Android test sources changed for the renamed constants; a compile error there would show on the Android CI job, not on a host.

Xget7 added 4 commits October 20, 2026 01:44
Every slot array and descriptor pool sized itself from a local copy of 2
(VulkanFrameLoop::kFramesInFlight and a kSlots in each of the visibility,
sort, LOD selection and frame compute classes). They now read
kFramesInFlight from layout/VulkanFrameSlots.h, so world/, frame/, raster/,
cull/, sort/ and selection/ no longer include presentation/ for a constant.

The visibility pass and the radix sort each declared their own KeyBits.
Both use layout/VulkanSortKeys.h now, which also names the 16 and 32 bit
widths that VulkanFrameCompute and the radix pass count passes from.

Behaviour, shader text and SPIR-V are unchanged: the generated .spv hashes
equal the layout baseline.
VulkanSplatRenderer decided selectsLodOnGpu() by querying the visibility pass
and the radix sort itself, so the renderer root knew which passes make up the
GPU frame. VulkanFrameCompute::supported(ctx) now answers that, and the
renderer no longer includes the sort header.

No behaviour change.
uploadWorld, uploadLodWorld and createSlab each repeated the same five
steps once the new world and frame compute were ready: store both, apply
the stored policy, bind the world to the pipeline and reset the world frame
completion. adoptWorld does them in that order. The waitIdle calls stay in
the callers exactly where they were, including uploadLodWorld having none
after the upload.

No behaviour change.
ShaderModule is now VulkanShaderModule, matching device/VulkanShaderModule.h
and the other device/ classes. The free function memoryBarrier in
device/VulkanBarriers.h is now vulkanMemoryBarrier, so it reads as the
Vulkan helper it is at its call sites in the passes.

No behaviour change.
@Xget7
Xget7 force-pushed the fix-android-seams branch from 72321be to 8e11c53 Compare October 20, 2026 04:44
@Xget7
Xget7 merged commit 9341a09 into main Oct 20, 2026
6 checks passed
@Xget7
Xget7 deleted the fix-android-seams branch October 20, 2026 04:45
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