Repository navigation
Normalize binary occlusion results in Vulkan replay - #889
Conversation
|
Tested cce77b6 on Windows 11, NVIDIA GeForce RTX 4080 SUPER (driver 32.0.16.1714), MSVC 14.51: pass
One thing builders should know: |
quackottu
left a comment
There was a problem hiding this comment.
Tested cce77b6 on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass
ctest -C RelWithDebInfo: 100% tests passed, 0 tests failed out of 33vk_binary_occlusion_test(changed here): exit=1 validation=0 | line 262: argc == 3- 32 test programs in the build pass with 0 validation errors
- Not run (they take an input file, not covered here): vk_binary_occlusion_test
d3d12_clear_testfails (R8G8B8A8_UNORM/SNORM 0.5 ties and a D16 clear byte differ from WARP) exactly as onmain4a36bb1 here, so not from this PR; #521 addresses it
Implicit Vulkan layers (overlays) were off through an empty VK_IMPLICIT_LAYER_PATH.
|
Tested
Code read, as the author of #258:
Two notes for whoever rebases or builds on this:
AI-assisted (Claude Code). |
|
Tested cce77b6 on AMD RDNA2 iGPU and RTX 5070: pass (first AMD and Blackwell runs; the PR was tested on an RTX 3090). Windows 11 Home 10.0.26300, MSVC 14.44.35207, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, Ninja RelWithDebInfo (
AI-assisted (Claude Code). No game files. |
|
Retested after both merges:
What changed since my run on
Still true: this and #940 conflict with each other ( AI-assisted (Claude Code). |
D3D-15 follow-up claimed in coordination issue #634.
What and why
D3D12 binary occlusion returns a 64-bit 0 or 1. Vulkan can return a sample count even without the precise flag. Replay now resolves binary results in chunks into a queue-owned scratch buffer, normalizes both words on the GPU, and copies the results into the application buffer. Ordinary occlusion still returns the sample count.
A binary resolve remains unconditional under predication. Replay suspends conditional rendering around the resolve and restores it afterward. Binary resolves require a compute-capable graphics queue.
Pipeline-statistics limitation
Replay refuses a binary resolve while a pipeline-statistics query is active. The internal dispatch would otherwise be counted in the application's
CSInvocations. Preparation rejects the list before submission.Tested
Tested
cce77b6against4a36bb1on Windows 11 build 26200 with an NVIDIA GeForce RTX 3090, driver 621.01, Vulkan SDK 1.4.363.0, and MSVC 19.44. The test seeds the query pool with synthetic Vulkan draws and resolves the results through the Leonida replay queue.mainreturned 64 where binary occlusion requires 1vk_binary_occlusionpassed with Vulkan and synchronization validation enabled, and again with validation disabled.vk_command_replay_testandd3d12_vulkan_devicepassed with Vulkan validation enabled.Checklist
AI-assisted (Codex).