Name all four pointer and size pairs in the XboxNativeComputePipelineStateDesc
struct as kinds 0, 1, 6, 7 per docs/fspx.md and name the slot
DeserializeComputePipelineStateX in slot_name, matching the DLL's messages.
This prepares the description struct for the runtime FSPX resolver follow-up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Xbox device slot 67 takes (desc, riid, out) with IID_ID3D12PipelineState and a console-only
descriptor with the root signature at +0x00 and code blob pointer/size at +0x28/+0x30.
Previously it logged and returned E_NOTIMPL.
Route it to CreateComputePipelineState on the PC device (slot 11) like slot 62, mapping the
console descriptor to D3D12_COMPUTE_PIPELINE_STATE_DESC. On the Vulkan device this resolves
through the translator via fssm_program and ShaderLibrary.
- Implement proxy_create_compute_pipeline_from_native_code in d3d12_xs_device.cpp
- Update device_proxy_test to verify slot 67 thunk, compute PSO creation over WARP, and argument checks
- Update d3d12_compute_test to verify slot 67 compute PSO creation on the Vulkan device
- Update documentation in d3d12_command_objects.md and d3d12_vulkan.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Write a 16-byte GFX10 raw buffer V# descriptor (48-bit BufferLocation, stride 0,
num_records = SizeInBytes, GFX10_FORMAT_32_UINT, OobSelect::raw) into the
32-byte CBV_SRV_UAV descriptor slot, zeroing the trailing 16 bytes (or the full
slot for a null description, zero BufferLocation, or zero SizeInBytes).
Verified on Windows 11 with RTX 5080 and Radeon Graphics in d3d12_compute_test:
64/64 dwords matched for CBV A, 32 in-bounds + 32 OOB-zero matched at +128, and
negative controls flipped 64/64 dwords for CBV B and null CBV.
AI Assisted.
Device creation enables subgroupSizeControl and computeFullSubgroups where the
GPU has them and keeps minSubgroupSize, maxSubgroupSize, the default
subgroupSize, maxComputeWorkgroupSubgroups and requiredSubgroupSizeStages in
VulkanDeviceInfo::subgroup (also printed at creation). CreateComputePipelineState
and CreateGraphicsPipelineState run decide_subgroup_size() per stage and chain
the result into the stage create-info; the "wave64 compute shader runs
32-wide" log line goes away. A size the device cannot give is logged once per
stage with the first shader's name, and tells the build to use
--wave64-emulate where that exists (compute, mesh).
pipeline_subgroup_requests() exposes what each stage of a PSO asked for.
vktest::Device fills the same properties and the compute and draw tests pass
them on.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pipelines (graphics and compute) whose translated shader declares set-0 bindings were refused. Their layout now
holds the device's bindless set 0 and replay binds it at every draw and dispatch. d3d12_m2_textured_test drives
heaps, SRVs, a POINT sampler, two root descriptor tables and DrawIndexedInstanced with a translated PS that
loads the T#/S# from the tables; 4096 of 4096 pixels match, and the descriptor hash table is checked.
d3d12_translated_draw_test is registered with ctest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's tests/test_ctest_registration.py (#1258) fails on this branch after
the merge: d3d12_compute_test, d3d12_draw_test and d3d12_present_test are
built but no add_test runs them.
They are registered like their neighbours, with SKIP_RETURN_CODE 77, and
return 77 when vktest::Device::initialize() finds no Vulkan device, as the
other registered D3D12 tests do. Without that, the CPU runtime job, whose
runner has no Vulkan driver, would fail on them the way it did on
d3d12_predicated_copy before #1314.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
From the reviews and test runs on #291:
- A pipeline without vertex bindings (a full-screen pass from SV_VertexID) no longer declares the vertex-stride
dynamic state, which nothing would set (VUID-vkCmdDraw-pStrides-04913; aslan2142, AlxcBTW, ezwinxdlmao).
- Logic ops are applied from RenderTarget[0] instead of being logged and ignored (Vonsek's XOR case), and
DepthClipEnable = FALSE is depth clamping (AlxcBTW). Both need their feature (logicOp, depthClamp), or the
PSO is refused.
- The standalone device also enables shaderInt64, shaderFloat64, shaderInt16, shaderClipDistance and
shaderCullDistance where the GPU has them (AlxcBTW, whattheflop: VUID-...-pCode-08740), plus logicOp and
depthClamp.
- Among index entries for one program, a PSO takes the first that fits and declares no set-0 bindings, as
pipelines do not bind set 0 yet. This covers the compute group in poke900310's corpus count, where an entry
with 10 bindings shadowed a binding-free one.
- The command list holds a reference to every root signature and pipeline state it is given until Reset or
its release, so releasing them right after Set* (as D3D12 allows) no longer leaves dangling layouts or drops
the submission (AlxcBTW).
After the rebase onto main: main's SetPredication reads the predicate through the resource's VkBuffer, so a
default-heap buffer (a range of the GPU address arena) adds its offset in the arena, and the arena gets the
conditional-rendering usage when the extension is on (lahlousaad4's integration note).
Tests: d3d12_draw_test has a second pass with a full-screen triangle first in its submission and an XOR quad,
and a depth-clamp refusal. d3d12_compute_test releases its root signature and PSO right after setting them,
sets the signature again after the arguments, and has a bound entry ahead of the binding-free one in its
index. Each new fix, undone on its own, fails a test: pStrides-04913, wrong XOR pixels, a heap-corruption
crash without the hold, a refused PSO without the binding-free choice.
Documented as known gaps, not fixed here: wave64 subgroup size (AlxcBTW's follow-up in #313), cross-queue
waits on one VkQueue and CPU fence signals below a pending GPU signal (woreksami), and the linear buffer_at.
Review feedback from IAmNotSiob:
- Both PSO paths declared a 144-byte push-constant range without consulting #224's limit. On a device with
maxPushConstantsSize 128 (the Vulkan minimum) that breaks VUID-VkPushConstantRange-size-00298 and returns a
bare E_FAIL. Both paths now refuse with E_NOTIMPL and log the limit until the uniform-buffer tail exists.
d3d12_compute_test checks this with a device that reports 128 bytes.
- The graphics range's stage flags are now the whole stage table create_graphics accepts, kept in
GraphicsPipeline::push_stages, and the replay pushes with the same flags. A geometry or mesh stage added to
the table is covered without another change.
docs/d3d12_vulkan.md section 5.2 now counts code-base readers per stage with the current translator: of the 662
shaders with s_getpc_b64, 53 VS, 92 PS, 246 MS and 263 CS read the code base. VS+PS pairs are only known at
PSO creation.
- GPU address arena (docs 3.3), when the device has bufferDeviceAddress: one
host-visible, device-addressable buffer (LEONIDA_ARENA_MB, default 256,
max 4095 so VAs fit 32-bit table pointers). Default-heap buffers are
64 KiB-aligned ranges with VA = offset, zeroed through the mapping;
shader-visible descriptor heaps live there (CPU handle = mapping, GPU
handle = VA); upload/readback buffers get VA = device address - heap
base; GetGPUVirtualAddress returns these.
- CreateRootSignature on main's model (rt::rootsig): parse_rts0, then
pack() for each parameter's place in the 32 user-data dwords; what pack()
refuses is refused with its reason. CreateComputePipelineState (PC slot
11, Xbox slot 62 via the proxy) finds the shader by the SHA-256 of its
FSSM program in the translator's index (VulkanDeviceInfo::shader_dir or
LEONIDA_SHADERS); its FSSM blob is copied into the arena as the code base.
Shaders that declare set-0 bindings are refused with a log until the
bindless set exists (M2).
- Command list: root signatures (arguments cleared on change), pipeline
state, constant / root view / descriptor-table setters for compute and
graphics, SetDescriptorHeaps, Dispatch recording the user data as it is,
ClearState (which also resets #164's stencil references); misuse makes
Close return E_INVALIDARG.
- Test helper and standalone device enable bufferDeviceAddress.
Test: d3d12_compute_test (through the proxy) creates the root signature
from the PC serializer's blob and the PSO through slot 62 in the measured
(desc, 0, 0, riid, out) shape (28cf235) from a container shaped like the
game's, sets root constants, a root UAV and a table whose
application-written entry points at an upload buffer, runs two dispatches
that each keep their own arguments, and reads the results back: 64/64
twice. Its shader is GLSL written to the translator's push-constant and
address contract, compiled with glslangValidator. Clean under the Khronos
validation layer, as are the other GPU tests; 13/13 ctest.