The device can allocate 1D textures and set 0 has a sampled 1D binding, but default and explicit views previously sampled the fallback. Use the texture dimension and the requested mip range when registering the view.
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>
CopyResource and CopyTextureRegion between D32_FLOAT and R32_FLOAT/UINT/SINT,
and between D16_UNORM and R16_FLOAT/UNORM, were refused at execution because
vkCmdCopyImage cannot mix a depth and a colour aspect. Host D3D12 and WARP
copy the bits, and #1134 listed these as not covered.
The replay now stages each such region image -> scratch buffer -> image.
The scratch comes from a new ScratchBuffers pool (vulkan_scratch.h):
device-local chunks handed out while a list is prepared and retired with
the submission's timeline value, like the depth24 converter's scratch, but
enabled on every GPU. Without it the copy is refused as unsupported before
anything is written.
Still refused: depth with stencil (two planes), D24 stored as D32, and
multisampled textures.
Tests: d3d12_copy_xfmt gains five depth <-> colour cases (R16 -> D16 both
ways, D32 -> R32_UINT, three mips, and a D32 -> R16 negative control), and a
depth <-> colour mismatch now fails it. vk_command_replay_test part H runs a
D32 -> R32 -> D32 round trip through the replay, and checks that a list is
refused with no scratch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the native attachment and feature-mask changes merged, Radeon could create and clear the resource despite a negative capability query. Check the advertised bit against the physical attachment capability before a focused test can skip.
These ID3D12Device5 methods are on the 'not planned until the game's trace shows
them' list and were still generated E_NOTIMPL stubs. Answer them as D3D12 does on
a device without the feature (and as vkd3d-proton does):
- EnumerateMetaCommands: no meta commands (count 0, S_OK; null count E_INVALIDARG)
- EnumerateMetaCommandParameters / CreateMetaCommand: unknown command, E_INVALIDARG
- CheckDriverMatchingIdentifier: UNRECOGNIZED for serialized acceleration
structures, UNSUPPORTED_TYPE for any other type
- RemoveDevice: GetDeviceRemovedReason reports DXGI_ERROR_DEVICE_REMOVED afterwards
Tested in d3d12_vulkan_device_test (RemoveDevice on a device of its own).
Second merge round: main added rgb96 views, the device filter, the
present source-rect path and its own ctest registration of
d3d12_present_test. bind_image keeps both defaulted parameters and the
rgb96 view fallback; image_descriptor runs main's 96-bit family check
before the castable-list check; Resource keeps main's rgb96_ member;
register_samplers and the presentation plumbing follow main's positions,
and the duplicated d3d12_present_test block and stale 'surfaces' local
are dropped in favour of main's.
main gained 117 commits since f85582e, among them #119 itself (through #908,
which is built on its head and adds PresentX on top), so both sides now
carry the presentation path: this branch as #119's own commits merged with
main at 426023a, main as #908's integration of them. Eleven hunks in six
files conflicted.
runtime/src/vulkan_present.h (2 hunks):
- present's blit: main's structure (a blank present, the source rectangle)
with both locks of the branch. record() reads and updates the context's
layout tracker, which ExecuteCommandLists guards with tracker_mutex_ (it
copies the tracker, emits, and commits the copy after the submit); under
the resource lock alone a present between that copy and that commit would
lose its update. Order as in the context: resource -> tracker -> submit.
- presentable(): identical code, main's comment.
runtime/shims/d3d12_vulkan_device.cpp (3 hunks):
- includes: shader_library.h stays (pipelines read the translator's index);
- Resource's fields: the branch's arena fields and main's rgb96_ (D3D-62);
- standalone device: info.presentation is set once, where the swapchain
extension is pushed (the branch's order); main set the same value later.
runtime/shims/d3d12_com.h (2 hunks): the union of the includes; the
branch's VulkanDeviceInfo::features and shader_dir stay.
runtime/CMakeLists.txt: main now builds and registers d3d12_present_test
next to xbox_present_test, so the branch's copy of that block goes; the
compute and draw tests keep theirs. d3d12_present_test keeps returning 77
without a Vulkan device, which main's registration (c2967a5) relies on but
main's test does not do yet.
README.md, docs/d3d12_vulkan.md (3 hunks): the branch's text. main's side
is what the branch had already merged at f85582e, unchanged since.
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.
D3D12 doesn't render to the shared-exponent format, but AMD's RDNA4 Vulkan driver (26.11.2) gives
E5B9G9R9_UFLOAT_PACK32 COLOR_ATTACHMENT and COLOR_ATTACHMENT_BLEND, and CheckFeatureSupport(FORMAT_SUPPORT)
passed them through as RENDER_TARGET, BLENDABLE and the multisample bits. d3d12_r9g9b9e5_uav (#1287) failed
on an RX 9070 at its RENDER_TARGET == 0 check. The format's render-target, blend, depth-stencil and
multisample bits are now cleared whatever the driver advertises.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Give each live standalone D3D12 queue its own graphics-family VkQueue so cross-queue Wait-before-Signal can progress. Preserve legacy caller-owned devices. AI-assisted (Codex).
On top of the merge candidate 70178d3 (Ryx69/Leonida#6, which merged main at
426023a): the 219 commits main gained since. Three hunks conflicted, in two
files; both follow the notes on #291 (ItsNotRexed 08:27 UTC, Vonsek 09:58 UTC
on 2026-11-22).
runtime/shims/d3d12_vulkan_device.cpp, device setup after the VulkanContext:
- the branch's GPU address arena is created first, as before;
- main's block that configures predication and the predicated byte copy
(#1277) follows it;
- one load_host_image_copy call and main's lazy D24 converter (enabled only
where D24_UNORM_S8_UINT is not usable) replace the branch's unconditional
enable_depth24, which was the same code before main changed it.
runtime/src/vulkan_replay.h:
- CopyBuffer: main's version. It already adds ResourceBinding::buffer_offset
to both offsets, as the branch did, and adds the overflow and overlap
checks and the predicated copy. With the arena, source and destination are
often the same VkBuffer; the overlap check compares the adjusted ranges.
- Predication: main's version. prepare() passes buffer_offset + the command's
offset to prepare_predicate, so a default-heap buffer inside the arena is
read at its own range; emit() captures the word and tests the capture's
scratch slot, not the application's buffer.
Everything else merged without conflicts. Nothing in main's 219 commits adds
a caller that takes a buffer's Vulkan device address for its GPU VA.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Radeon advertises a color attachment for shared-exponent textures. Allow the native path to create the resource and RTV while keeping the mutable R32 UAV backing unavailable for render targets.
test_fma_khr put tools/ on the path only through support, so it failed when
run alone; it now inserts TOOLS_DIR itself like test_f16_fma_rounding. The
standalone device no longer prints on every start when the feature is
missing (the tools refuse an FMAKHR module where it matters).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The converter was made only where the GPU lacks D24_UNORM_S8_UINT (1c5463b4). 96-bit textures need it on every
GPU, so it is always created; it costs nothing until a copy uses it (lazy pipeline, lazy tracker lock).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- depth24_convert_test: 96-bit texels split into rows (1 KiB range) and slices (1 MiB range).
- d3d12_rgb96_test: an upload and a readback on a COPY queue; GetCopyableFootprints refuses what creation
refuses (as WARP); returns 77 without a Vulkan GPU or WARP so ctest skips; large timings behind LEONIDA_RGB96_LARGE.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
R32G32B32_FLOAT/UINT/SINT/TYPELESS textures were refused ("texture format not
supported yet"). They are now R32G32B32A32 images on every GPU: most have no
optimal-tiling RGB32 image, and one that has would not avoid the repack, since
D3D12 places subresources at multiples of 512 bytes and Vulkan wants a copy's
buffer offset to be a multiple of the texel size
(VUID-vkCmdCopyBufferToImage-dstImage-07975).
- Footprints keep D3D12's 12-byte texels (compared with WARP).
- CopyTextureRegion between a texture and a buffer is repacked by the D24
compute pass (depth24_convert.comp modes 2 and 3, Depth24Job::rgb96): the
same scratch, parts and lifetime, texels of three words in the footprint and
four in the scratch, copied uninterpreted. depth24_convert.inc is
regenerated with the documented glslc command; the same glslc reproduces the
previous blob byte for byte from the previous source.
- WriteToSubresource/ReadFromSubresource take the staged copy, as D24-as-D32.
- A view's T# names GFX10_FORMAT_32_32_32_*, so alpha reads as one.
- Refused: unordered access and depth (as WARP), render targets (WARP has
them; not done, and FORMAT_SUPPORT and GetResourceAllocationInfo agree),
copies between a 96-bit and a four-channel texture, views of another
format family.
Tested on an RX 9070 XT (AMD 26.11.2), Windows 11: d3d12_rgb96_test matches
WARP and the expected texels bit for bit for 4 formats as 2D arrays with mips
and as volumes; d3d12_descriptor_test samples FLOAT, UINT and TYPELESS views.
Clean under the validation layer with sync validation; depth24_convert_test
and ctest (62) pass.
AI-assisted (Claude Code).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
GLSL.std.450 Fma may be split into two roundings by a driver (Vulkan
environment: inherited from OpFMul followed by OpFAdd); RDNA2 v_fma_* round
once. --fma khr (default stays glsl) emits OpFmaKHR with capability FMAKHR and
SPV_KHR_fma and lists shaderFmaFloat32 in the index. Runtime device creation
and the vk_* test programs enable VK_KHR_shader_fma when present; cs_fma_fused
tests single rounding; the mini interpreter learns OpFmaKHR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main moved (c0ac5fd): vulkan_replay.h takes main's checked buffer copies (predicated copies, overlap and overflow
refusals). README's Xbox row is rebuilt from both sides (the previous merge commit had committed a zero-filled
README.md; this restores it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts (both sides kept): runtime/CMakeLists.txt (stub list), d3d12_com.h, d3d12_vulkan_device.cpp (arena buffers
with main's ray-tracing buffers and deferred destruction, calibrated timestamps, instance extensions, sampler
registration next to the window presenter), command_list.h, vulkan_backend.h, vulkan_replay.h, vk_test_device.h,
d3d12_state_map_test.cpp, docs and README. vulkan_present.h takes main's resource and tracker locks.
CI (linux-gpu-tests): ps_m15 and vs_m15 belong to d3d12_translated_draw_test. run_gpu_tests.py still assembles and
translates them but reports them as skipped (OTHER_HARNESS) instead of "no checker defined".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Intel's D3D12 driver reports a fixed WaveLaneCountMin/Max of 16 on its
integrated GPUs, where Vulkan reports the compiler's 8..32 range, so
compare_options1 failed on every Intel iGPU. Measured on Xe-LP: UHD 770
(32.0.101.6129) and Raptor Lake-S Mobile (101.7092). Discrete Arc keeps
the Vulkan range until TEST-57 measures it.
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.
- register_samplers (main) and create_window_presenter (stack) both kept.
- Resource dtor: stack arena release + main deferred destroys.
- AS binding: main size/host_readable + stack console va.
- VulkanContext: main's lock split kept; stack arena/pipeline accessors
moved to resource_mutex_ (execute copies replay_ under its shared lock),
presenter lookups take it shared.
- README takes main wholesale; D3D-90 code and tests untouched.
Resolved along the lines in #291 (comment by ItsNotRexed, 2026-11-22 08:27):
- Default-heap buffers stay in the GPU address arena: a VA is an arena offset,
and every buffer's device address is heap_base + VA (upload and readback
buffers: device address minus heap_base, as before).
- Acceleration structures: a buffer created in RAYTRACING_ACCELERATION_STRUCTURE
state on a ray-tracing device stays out of the arena and keeps main's model,
its VA being the VkAccelerationStructureKHR's device address, so BLAS
addresses in TLAS instance descriptions are what Vulkan reads. It is
registered by that VA. BuildRaytracingAccelerationStructure turns build
inputs and scratch into heap_base + VA, and the arena gets the build-input
usage on ray-tracing devices. Resource keeps one va_ (gpu_va_/buffer_va_
removed).
- buffer_at keeps the size& signature; main's only caller (WriteBufferImmediate)
is the branch's version, and ExecuteIndirect resolves its buffers by id.
- ~Resource keeps arena_release and main's defer_destroy.
- Main's split context locks: pipeline registration and heap_base/zero page
take resource_mutex_ (prepare looks pipelines up under its shared lock);
VulkanPresenter takes resource_mutex_ shared, plus tracker_mutex_ while it
records the back buffer's transition.
- Standalone device: main's single instance-extension list and DXGI swapchain
enable; info.presentation follows the same swapchain/surface condition, so
create_window_presenter keeps working. Main's DeferredDeletionQueue,
calibrated timestamps and ray-tracing extensions are kept next to the
branch's presentation and feature enables.
- Command IR: Dispatch and Draw follow main's DebugMarker, ExecuteIndirect and
BuildAccelerationStructure in the variant.
Literal GFX10 samplers can encode bias from -32 to +31. A decoded +31 exceeded the Vulkan sampler limit on both tested devices at registration. Bound the native bias while retaining the original S# for shader lookup.