| Age | Commit message (Collapse) | Author |
|
(RT-SAMPLE-LOCATIONS-MSAA-ONLY)
#778 filled the sample-locations grids from 1 sample upwards, so every 1x depth-stencil image was created
sample-locations compatible and carried sample locations through its transitions. D3D12 only has programmable
sample positions for multisampled targets; since #778 the world phase loses the device on an RTX 5080. Keep 1 sample
out (SamplePositions::programmable_count): 1x depth images are plain again, MSAA keeps the feature.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gt9hwPPpwX5RYWwXCnj43U
|
|
Conflicts, all kept from both sides:
- GraphicsPipeline: main's rectangle_stage took bit 9, so custom_samples
moves to bit 10; sample grids sit next to main's async_build.
- The pipeline variant appends VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT to
main's dyn_list (8 entries at most) and keeps main's lazy shader modules.
- initialize() takes main's per-aspect zeroing and depth-UAV paths and still
passes the active sample positions to every barrier.
- prepare_draw keeps main's skip/quad-index handling and the sample
positions argument; emit_commands keeps active_samples, including main's
clear-pattern round trip and the release (into UNDEFINED) barriers.
- Texture creation keeps main's 1D/3D UAV limits and the sample grid.
- Both new replay_texture_barrier_test cases are kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
the layout (D3D-BARRIER-INTO-UNDEFINED)
CommandList::barrier(TextureBarrier) refused LayoutAfter = UNDEFINED from a
defined layout, so the list's Close failed. D3D12 allows it: the contents are
no longer needed, as before the memory is aliased. WARP closes such a list
(measured on Windows 11 26340 in #984), and #984 reports that the retail title
ends a depth buffer's use this way and takes the failed Close as fatal.
The rule goes. Vulkan has no transition into UNDEFINED
(VUID-VkImageMemoryBarrier2-newLayout-01198), so replay gives each piece a
barrier with oldLayout = newLayout, the layout the tracker has for it, which
orders the accesses and changes nothing in the image; the tracker keeps the
layouts. A piece that was never used gets no barrier and is not zero-filled
for it. The next barrier starts from UNDEFINED and discards, as before.
UNDEFINED -> UNDEFINED is not touched here: that is #600.
The barrier half of item 2 of the split proposed in #984, carried onto main
from Moriz82's integration branch (command_list.h, the emit change and the
command_list_test, replay_texture_barrier_test and d3d12_close_parity_test
cases), restricted to a defined LayoutBefore, with more cases and two GPU
tests added.
Tests:
- command_list_test, replay_texture_barrier_test (CPU): the recorded barrier;
kept layouts over mips in two layouts, with the discard flag and without a
tracker; an unused image released without a barrier or a zero-fill; the
barrier from UNDEFINED that follows.
- d3d12_close_parity_test: three enhanced-barrier rows (116 cases, 85 match).
- vk_command_replay_test part K (GPU): a colour target, a depth buffer whose
planes are in two layouts and an unused image released; the target used
again and read back.
- d3d12_com_test (GPU, D3D12 list and queue): a depth buffer cleared,
released, taken from UNDEFINED again, cleared and read back.
Co-authored-by: Moriz82 <72836413+Moriz82@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
|
|
|
fails the list
`CommandList::clear_depth_stencil` (`runtime/src/command_list.h`) refused a `ClearDepthStencilView` whose depth was
outside [0, 1] or NaN, and one whose `D3D12_CLEAR_FLAGS` were 0, so `Close` answered `E_INVALIDARG` and the whole
`ExecuteCommandLists` submission was dropped. Windows' D3D12 closes those lists: on WARP a `D32_FLOAT` target keeps
1.5, -0.5 and NaN exactly as given, and a clear that names no plane clears nothing. `d3d12_clear_test` now reads those
back on WARP and on the layer, and `d3d12_close_parity_test` measures the four `Close` verdicts.
A title that clears depth with a computed value (or wraps the clear in a flag mask that can be 0) lost that frame's
depth clear and, with it, the whole submission's work. The call is now recorded with the depth as given (a D16 target
still quantizes at replay) or, with no plane named, recorded as nothing.
d3d12_clear_test adds three read-back comparisons (1.5/-0.5, NaN, flags 0), command_list_test asserts the accepted
calls and the stored values, and the four close-parity rows move from the known-difference table to `match`.
|
|
AtomicCopyBuffer validation (#6815)
Squash-merged after diff review of PR #6815
|
|
Squash-merged after diff review of PR #6825 - d3d12: validate DXR acceleration-structure prebuild and recording inputs
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
|
|
|
|
CreateQueryHeap(D3D12_QUERY_HEAP_TYPE_SO_STATISTICS) returned E_NOTIMPL, so
a title that makes one got nothing. The layer has no stream output (a PSO
with StreamOutput entries is refused, SOSetTargets is not implemented), so
every SO_STATISTICS_STREAM0..3 query counts 0 written and 0 needed.
Such a heap is now made without a VkQueryPool: Begin/EndQuery record nothing
in Vulkan (the D3D12 call rules and the ended tracking still apply), the
queries overlap no occlusion or statistics query, and ResolveQueryData fills
16 zero bytes per query (D3D12_QUERY_DATA_SO_STATISTICS) with no statistics
split. When stream output lands this becomes a
VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT pool.
Mesh-shader statistics (PIPELINE_STATISTICS1) are left to D3D-132.
|
|
set stays on the parent
A draw recorded in a bundle took the bundle's own viewport, targets, root
arguments and buffers. A bundle cannot set a viewport, so every bundle draw
was dropped without an error, and nothing of the parent's state reached it.
Only the stencil reference and the blend factor were handed back.
Inside a bundle, state calls, draws and Dispatch are now kept as deferred
calls, and ExecuteBundle plays them on the parent through the members a
direct call uses, between the bundle's state-free commands, in order. A
draw sees the parent's state plus what the bundle set, and what the bundle
set stays on the parent, as measured on the PC runtime. This replaces the
stencil-reference and blend-factor carry-back fields. Trace lines are
written once, when the bundle records the call.
ClearUnorderedAccessView is refused in a bundle, like the other clears.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
|
Both sides extended the same spots: the PR's castable-format flag and main's
R9G9B9E5-as-R32_UINT view emulation meet in bind_image (two extra defaulted
parameters), image_descriptor's view format (resource_format + castable list),
create_texture (TextureCreateInfo carries the VkImageFormatListCreateInfo the
castable list fills) and the device init (arena creation plus main's predication
configuration). Main's hardened CopyBuffer preparation and predicate capture
keep the PR's arena-buffer offsets; the PR's old emit-side offset math is
superseded by main's prepare-side buffer_offset handling.
|
|
Build on the full 64-bit predicate snapshots from #856. Replay predicated buffer copies through a storage8 compute helper, retain descriptor batches through timeline completion, and reject missing capabilities or active statistics queries before submitting work.
Validate byte offsets, high predicate words, bounds, skipped destinations and pending descriptor lifetimes with CPU checks, 180 native WARP comparisons and 64 gated/reused GPU submissions. The existing OPTIONS19 host-capability mismatch also reproduces on base 4a36bb1; no tests are disabled.
|
|
First pieces of D3D-3 (compute path), no pipelines wired up yet:
- shader_library.h: FSSM extraction from the DXBC container (DXIL, XDAT
0x0D, XBCH, zlib), SHA-256, a minimal JSON reader and the
spirv/index.json lookup by fssm_sha256. Self-contained inflate, no
dependencies.
- IR Dispatch with user data captured at record time; replay binds the
pipeline, pushes the 144-byte block (s0..s31, heap base, code base) and
dispatches. Arena buffers get a buffer_offset that copies honour.
- Root signatures use main's model (runtime/src/root_signature.h); the docs
say so.
Tests: shader_library_test (FIPS 180-4 vectors; stored, fixed and dynamic
deflate blocks; corrupt and truncated streams; FSSM from a synthetic
container) joins ctest; command_list_test covers dispatch recording.
|
|
CreateQueryHeap makes one VkQueryPool per heap: occlusion (OCCLUSION and
BINARY_OCCLUSION queries), timestamp and copy-queue timestamp, and pipeline
statistics (all eleven Vulkan counters, whose order is the field order of
D3D12_QUERY_DATA_PIPELINE_STATISTICS). Other heap types are logged and
refused with E_NOTIMPL.
BeginQuery, EndQuery and ResolveQueryData are recorded in the command-list
IR with D3D12's rules for the calls, and replayed as vkCmdResetQueryPool +
vkCmdBeginQuery/vkCmdEndQuery, vkCmdWriteTimestamp at BOTTOM_OF_PIPE and
vkCmdCopyQueryPoolResults (64-bit, WAIT). Heap types, index ranges and the
destination buffer are checked before anything is written. A query that was
never ended resolves to zeros instead of stalling the GPU on WAIT_BIT.
GetTimestampFrequency is 1e9 / timestampPeriod. The devices enable
occlusionQueryPrecise and pipelineStatisticsQuery where the GPU has them.
Overlapping queries of one kind (valid D3D12, one active query per type in
Vulkan) are refused as unsupported, and binary occlusion is not clamped to
0/1 yet; both are written down in docs/d3d12_vulkan.md section 4.6.
Tested on an RTX 5070 (driver 621.01) under VK_LAYER_KHRONOS_validation.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
A region with NumSubresources = UINT_MAX was recorded like a null region and
skipped the FirstSubresource check. DiscardResource now has a whole flag;
explicit ranges are checked in 64-bit at recording and replay. Tests at the
UINT_MAX boundary in command_list_test, part F and the COM device test.
Found by matheuskshn in review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
main added SetPredication (D3D-18) and reserved resources; both sides are
kept. The predication replay test took part E, so the D3D-26 test is now
part F. An atomic copy recorded under a predicate is counted with the
other copies that Vulkan's conditional rendering cannot skip, and
SetPredication, DiscardResource and the atomic copies are all refused in
a bundle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
the bundle rules
main added ExecuteBundle (command_list.h, d3d12_com.cpp) and samplers
(vulkan_backend.h); both sides are kept. DiscardResource and the atomic
copies are now refused in a bundle, as D3D12 documents, and
WriteBufferImmediate is allowed there (d3d12_com_test covers all four).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
- command_list.h: a Predication command (offset 8-byte aligned, EQUAL_ZERO or
NOT_EQUAL_ZERO; a null buffer turns it off), recorded by
GraphicsCommandList::SetPredication.
- vulkan_replay.h: begin/end conditional rendering (INVERTED for NOT_EQUAL_ZERO),
ended before a new predicate and at the end of the list. While predicated,
whole-view clears go through vkCmdClearAttachments, which conditional rendering
covers. New ReplayResult::invalid_predication; PreparedList::unpredicated_copies
counts copies Vulkan cannot predicate.
- Device: VK_EXT_conditional_rendering and its feature enabled when present, and
buffers created with VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT; without it a
predicated list is unsupported.
- Tests: command_list_test (recording rules), vk_command_replay_test part C (GPU).
- docs/d3d12_vulkan.md 4.7: what is done; copies and the 64-bit value are open.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
|
|
(D3D-26)
Three command-list IR commands, recorded through COM and replayed by
vulkan_replay.h:
- DiscardResource: an oldLayout = UNDEFINED barrier to the layout the
tracker already has for each subresource. Buffers, rectangle discards,
parts never used yet, untracked replays and one plane of a combined
depth-stencil without separate layouts are no-ops.
- WriteBufferImmediate: a 4-byte vkCmdUpdateBuffer at the address,
resolved at execution through ResourceBinding::va / buffer_offset and
ReplayFunctions::buffer_at (the same fields and lookup as #291).
MARKER_OUT waits for and sees every earlier write; MARKER_IN gets an
execution-only ALL_COMMANDS dependency (Vulkan cannot say "started");
DEFAULT is ordered by the application's barriers.
- AtomicCopyBufferUINT/UINT64: one vkCmdCopyBuffer region after a
barrier that covers every earlier write, the dependent resources'
included. Recording follows the debug layer's ATOMICCOPYBUFFER_* and
WRITEBUFFERIMMEDIATE_* rules.
Tests: command_list_test (recording rules), vk_command_replay_test part D
(GPU readback of writes in all three modes, ordered atomic copies,
discards, and the lists that must be refused), and the COM path in
d3d12_vulkan_device_test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
There was no resolve, and a multisampled committed texture was refused.
- IR: ResolveSubresource (two different resources).
- Replay: ResolveSubresource is vkCmdResolveImage in the layouts copies
use: a multisampled colour subresource into a single-sampled 2D one of
the same size and format. Depth-stencil resolves and resolves between
two formats of a typeless family stay unsupported. ResourceBinding gains
samples: a multisampled texture copies only to its own sample count and
has no footprint.
- Device: committed multisampled 2D textures (single-mip render targets or
depth-stencils, when the GPU has the sample count for the format; the
other shapes are E_INVALIDARG as in D3D12), and TEXTURE2DMS
render-target and depth-stencil views.
- COM: ID3D12GraphicsCommandList::ResolveSubresource.
Tests: command_list_test (recording rules, and a copy with a z range);
vk_command_replay_test part C (a 4x resolve and the refused resolves and
multisampled copies; it also runs the volume copies that are already on
main at the Vulkan level, on Linux too: a 4x4x4 volume uploaded, copied as
a block and whole, read back, and the z ranges that must be refused);
d3d12_vulkan_device_test (a resolve through the Xbox-ABI proxy and the
refused shapes).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
|
GetCopyableFootprints
- IR: CopyBufferRegion, CopyTextureRegion (subresource or placed footprint,
optional box) and CopyResource, with D3D12's call rules (512-byte footprint
offsets, 256-byte pitches, non-empty boxes).
- Replay: vkCmdCopyBuffer / CopyBufferToImage / CopyImageToBuffer / CopyImage.
Footprint pitch becomes bufferRowLength; BC extents stop at the mip edge;
every range and buffer bound is checked before anything is written. Copies
run in TRANSFER_SRC/DST, or in place in GENERAL for a COMMON texture
(implicit promotion). 2D only.
- Device: buffers expose their VkBuffer; BC1-7 formats; textureCompressionBC
enabled when present; GetCopyableFootprints for buffers and 2D textures.
Compared with the PC runtime over 13 descriptions, which showed planar
depth-stencil rows are padded to 512 bytes.
- Each submission ends with a barrier to the host so readback buffers hold the
GPU's writes after the fence wait. BC textures are not zero-filled on first
use (Vulkan cannot clear them; the validation layer caught the first try).
Tests: d3d12_vulkan_device_test now reads results back through D3D12
(CopyTextureRegion into a readback heap, Map) and adds an upload list: a
pattern into a texture, CopyResource into a COMMON texture, a boxed copy, a BC1
round trip and CopyBufferRegion. command_list_test covers the copy rules. All
GPU tests are clean under the Khronos validation layer; 6/6 ctest.
|
|
list/queue/fence
Closes the gaps left by the barrier/clear slice:
- Rectangle clears: ClearRenderTargetView/ClearDepthStencilView rects are
recorded and replayed with vkCmdClearAttachments in a dynamic-rendering
scope, clipped to the mip.
- LayoutTracker: the current Vulkan layout per image subresource, so barriers
start from the real layout. This honours implicit promotion and decay
(COMMON is GENERAL; simultaneous-access textures stay GENERAL) and, with
separateDepthStencilLayouts, lets one depth/stencil plane be cleared or
transitioned while the other stays in another state.
- Enhanced barriers (global, buffer, texture, split, discard) mapped to
vkCmdPipelineBarrier2.
- vulkan_backend.h: VulkanContext, VulkanQueue (ExecuteCommandLists checks
every list before writing any; Wait is attached to the next submission),
VulkanFence on timeline semaphores.
- d3d12_com.cpp: ID3D12GraphicsCommandList7, ID3D12CommandQueue,
ID3D12CommandAllocator and ID3D12Fence1. Unimplemented methods are stubs
generated at build time from the SDK's d3d12.h (tools/gen_d3d12_stubs.py),
so vtables follow the SDK order and nothing SDK-derived is checked in.
Tests: command_list_test and d3d12_state_map_test (every copied D3D12
constant checked against d3d12.h) in ctest; vk_command_replay_test and the new
d3d12_com_test on the GPU, clean under the Khronos validation layer.
|
|
The IR (command_list.h, was clear_commands.h) now records transition, UAV and
aliasing barriers (split barriers record their end half) and full-view
ClearDepthStencilView next to ClearRenderTargetView.
vulkan_replay.h (was vulkan_clear.h) maps D3D12 resource states to Vulkan
layout/access/stage (section 4.3 table), decodes subresource indices including
depth/stencil planes, validates the whole list before emitting anything, and
wraps clears in a layout round trip so images stay in their D3D12 state. The
caller no longer manages layouts by hand.
Tests: command_list_test (recording rules), d3d12_state_map_test (state table,
subresource decoding, constants checked against d3d12.h; needs Vulkan headers
only) and vk_command_replay_test (GPU readback of colour, depth and stencil;
LEONIDA_VK_VALIDATION=1 runs it under the Khronos validation layer).
|