Repository navigation
d3d12/vulkan: replay full graphics state for ExecuteIndirect DRAW and DRAW_INDEXED (D3D-EXECIND-GRAPHICS) - #499
Conversation
|
Reviewed 72f8719 and tested under Wine 11.20 on Linux with an RTX 3060. d3d12_indirect_draw passed all 11 cases, along with the focused indirect, direct-draw and replay tests I ran. Under Wine, the new draw test checks two pixels per case; its native Windows D3D12 comparison is skipped. I found one feature-handling issue using custom Vulkan devices with features deliberately disabled:
As a control, max_count = 1 with multiDrawIndirect disabled passed without a draw validation error. Could replay gate these paths on the enabled features, or provide a supported fallback? The new draw test built against the baseline triggered draw validation errors and hung submission, so it did distinguish the original path in my run. d3d12_indirect_zero skipped under Wine; d3d12_indirect_dispatch_count failed identically on the PR and baseline. AI-assisted review and validation. |
|
Thanks for the thorough review and testing on Linux/Wine + RTX 3060, @moffington! Great catch on custom Vulkan devices with those features disabled. Fixed in
Re-verified on Windows 11 26200 / NVIDIA GTX 1650 ( AI-assisted fix and verification. |
…on multiDrawIndirect and drawIndirectCount # Conflicts: # runtime/shims/d3d12_vulkan_device.cpp # runtime/src/vulkan_replay.h # runtime/test/vk_test_device.h
…nd multi-scissor rendering (1..16 viewports/scissors) Resolved against ProjectLeonida#499's emit_graphics_pass, ProjectLeonida#469's depth bounds and ProjectLeonida#511's lazy modules: the viewport/scissor setup moves into emit_graphics_pass, the pipeline's dynamic-state list keeps DEPTH_BOUNDS and picks the *_WITH_COUNT states, and ProjectLeonida#499's ExecuteIndirect draws now carry the bound depth bounds and viewports like record_draw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd depth bounds (ProjectLeonida#469), like record_draw Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased cleanly onto Re-verified on Windows 11 26200 / NVIDIA GTX 1650: |
bc243a4 to
3093a84
Compare
Claimed in the coordination issue as: D3D-EXECIND-GRAPHICS (#14 (comment))
Depends on: #469 (adjacent lines in
vulkan_replay.hdraw replay,d3d12_vulkan_device.cppfeature enables, andvk_test_device.hif both merge; this branch is based cleanly on currentmain8f481cf16with no code dependency on #469)What and why
Previously,
ExecuteIndirectfor graphics draw signatures (D3D12_INDIRECT_ARGUMENT_TYPE_DRAWandD3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED) only validated the argument/count buffers and emitted a barevkCmdDrawIndirect*call without snapshotting graphics state, starting dynamic rendering, or binding the graphics pipeline, render targets, push constants, viewport/scissor, or vertex/index buffers. In addition, neithercreate_vulkan_device_standalonenorvktest::Deviceenabled Vulkan'smultiDrawIndirectordrawIndirectCountfeatures required formax_count > 1and GPU count buffers.runtime/src/command_list.h,runtime/shims/d3d12_com.cpp):bool has_draw+Draw drawtoleonida::ExecuteIndirect.ExecuteIndirectis recorded fordrawordraw_indexedwithmax_command_count > 0and a bound graphics pipeline, root signature, and primitive topology, snapshots the full graphics state (pipeline, root user data, render targets, depth target, vertex/index buffer views, viewport, scissor, blend factor, stencil refs), matchingDrawInstanced/DrawIndexedInstanced(including the zero-viewport early-out).has_draw == falsewhen no graphics PSO is bound ormax_command_count == 0, preserving existingClose()validation parity (d3d12_indirect_zero_test,d3d12_execute_indirect_validation_test) and bare-IR tests (d3d12_indirect_rt_test).runtime/src/vulkan_replay.h):ind->drawviadetail::prepare_draw(resolving targets, format variants, vertex buffers, and index buffer).emit_graphics_passhelper used by both directDrawand graphicsExecuteIndirectso dynamic rendering, attachment layout transitions, pipeline, bindless set, push constants, dynamic state, and vertex/index buffer bindings are identical.max_count == 0as a clean no-op without opening an empty render pass.runtime/shims/d3d12_vulkan_device.cpp,runtime/test/vk_test_device.h):VkPhysicalDeviceFeatures::multiDrawIndirectandVkPhysicalDeviceVulkan12Features::drawIndirectCountwhere supported by the GPU.runtime/test/d3d12_indirect_draw_test.cpp):d3dcompiler_47for host reference).DRAWfixed/multi/padded-stride,DRAWwith GPU count buffer 0/1/clamped 5>2,DRAW_INDEXEDmulti/padded-stride withBaseVertexLocation,DRAW_INDEXEDwith GPU count buffer 1/2, andmax_count = 0no-op), comparing all 64/64 pixels byte-for-byte against host Windows D3D12 on the same adapter.Tested
d3d12_indirect_draw_test,d3d12_indirect_zero_test,d3d12_execute_indirect_validation_test, andd3d12_state_map_testwith MSVC 19.44 (vcvars64) + Ninja on top ofmain8f481cf16.d3d12_indirect_draw_test: ALL 11 CASES PASSED (EXACT MATCH vs host D3D12) — 64/64 pixels exact on every case on NVIDIA GeForce GTX 1650 with 0 validation errors.d3d12_indirect_zero_test: PASSED (6/6 exact vs GTX 1650 & WARP).d3d12_state_map_test: PASSED.py -3.13 -I scripts/check_no_game_data.pyon all 7 touched files: clean.GPUs tested: NVIDIA GeForce GTX 1650 Mobile 4 GB (driver 592.00, Vulkan 1.4.325, Windows 11 26200)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — D3D12 → Vulkan runtime only)