mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1222] d3d12_vulkan_device_test: resource flags 0x200 and 0x400 go by the host's tight-alignment support (TEST-DEVICE-FLAGS-TIGHT-ALIGNMENT) #1254
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1254
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1222
Author: @MalexAson
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/device-test-resource-flag-hosts📝 Commits (1)
8c73655d3d12_vulkan_device_test: resource flags 0x200 and 0x400 go by the host's tight-alignment support (TEST-DEVICE-FLAGS-TIGHT-ALIGNMENT)📊 Changes
1 file changed (+54 additions, -7 deletions)
View changed files
📝
runtime/test/d3d12_vulkan_device_test.cpp(+54 -7)📄 Description
Claimed in the coordination issue as: TEST-DEVICE-FLAGS-TIGHT-ALIGNMENT
What and why
d3d12_vulkan_devicefails on my PC atargument_mismatches <= 0after these three lines ofcompare_invalid_arguments, and everything else in the test matches the host:I first reported this as an Intel host quirk (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142087413). That was wrong for this PC: the Intel Iris Xe, the RTX 4060 Laptop and WARP all answer the same, so it is the D3D12 runtime,
D3D12Core.dll10.0.26100.5074 (Windows 11 24H2, build 26100.6584).What the flags are, from Microsoft's public headers and specification:
D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT. It first appears in DirectX-Headers v1.618.1 together withD3D12_FEATURE_D3D12_TIGHT_ALIGNMENT(54, oneD3D12_TIGHT_ALIGNMENT_TIER); the Windows SDK 10.0.26100 header has neither. DirectX-Specs (d3d/D3D12TightPlacedResourceAlignment.md) listsE_INVALIDARGfor the flag when the feature is reported asD3D12_TIGHT_ALIGNMENT_TIER_NOT_SUPPORTED.D3D12_RESOURCE_FLAG_VIDEO_PROCESS_3DLUT_ONLY, named in DirectX-Headers from v1.620.1 on.What hosts answer. The newer runtimes are the
D3D12Core.dllof Microsoft's Agility SDK (NuGetMicrosoft.Direct3D.D3D121.618.5 and 1.620.2), loaded by a probe and by a local build of this test that opts into them:E_INVALIDARGTIER_1NOT_SUPPORTEDE_INVALIDARGID3D12Device11toID3D12Device14. SoID3D12Device11on the host, the condition commit31d279823gave the two 0x400 cases, does not tell whether the host accepts the flag: the runtime has to know the flag and the driver has to reportTIER_1.D3D12_RESOURCE_DESC::Flags has unrecognized bits. The value is 0x400, and the unrecognized bits are 0x400.Flags can only have D3D12_RESOURCE_FLAG_VIDEO_PROCESS_3DLUT_ONLY set when D3D12_RESOURCE_DESC::Dimension is D3D12_RESOURCE_DIMENSION_TEXTURE3D(their debug layer), and accept it on a 3D texture. 10.0.26100.5074 accepts it on a buffer and on 2D and 3D textures. The 0x200 case had no condition at all.The layer's answers to the three cases are those of a newer runtime on a driver with tight alignment, and this pull request does not change the layer.
The change, in
runtime/test/d3d12_vulkan_device_test.cpponly:host_tight_alignment: the host answers feature 54 with a tier aboveNOT_SUPPORTED. The two 0x400 cases are compared on such a host, instead of on one withID3D12Device11. Windows 10 and Windows 11 23H2, which the old condition was written for, refuse the flag, so they cannot reportTIER_1and stay not comparable.host_knows_tight_alignment: the host answers feature 54 at all, which makes its runtime 1.618 or newer. The 0x200 case is compared on such a host. On an older host the case is now held to the recorded answer instead of the host's; on Windows 10 and 23H2 the two are the same (the case had no condition and the test passed there).Case::recorded: the layer's answer for a case, checked where the host is not comparable. The three cases have one (E_INVALIDARG,S_OK,S_OK). Until now a host that was not comparable checked nothing for a case, and one that happens to answer as a wrong layer does would have hidden it; the first negative control below is that situation.ID3D12Device11cases now says three.Tested
main58be9cdf8(built at6293c1c4f;runtime/is identical between the two), MSVC Build Tools 2026, Ninja, RelWithDebInfo, Windows SDK 10.0.26100.0. The test takes the layer's own adapter as its host, so each line is layer and host on the same GPU unless it says WARP.Host runtime 10.0.26100.5074 (in the box):
LEONIDA_VK_DEVICE=irisand=4060: exit 1, the three lines above, on both.not comparable on this host (ours ..., host ...). The same withLEONIDA_HOST_ADAPTER=warp.committed_resource_refusaltakes 0x200 and not 0x400, exactly as this host answers): exit 1 on both GPUs withours 0x00000000, recorded 0x80070057 (host 0x00000000, not comparable)for 0x200 andours 0x80070057, recorded 0x00000000 (host 0x80070057, not comparable)for the two 0x400 cases. Withoutrecordedthis run passes.Host runtime 1.618.5 (the test built locally with
D3D12SDKVersion/D3D12SDKPathexports appended; not part of this pull request). Every run on this runtime also prints two lines that this change neither causes nor touches,resource flag RAYTRACING_ACCELERATION_STRUCTURE on a buffer/on a texture: ours 0x00000000, host 0x80070057(the newer runtime wantsALLOW_UNORDERED_ACCESSwith that flag), so the exit code is 1 throughout. That is a separate matter and not part of this change. For the three cases of this pull request:TIER_1) they agree with the host. On the Iris Xe and with WARP as host (NOT_SUPPORTED) the two 0x400 cases fail,ours 0x00000000, host 0x80070057. So the old condition also fails on a current runtime wherever the driver has no tight alignment.not comparable, and 0x200 is compared and equal.0x200 on a buffer: ours 0x00000000, host 0x80070057,0x400 ...: ours 0x80070057, host 0x00000000twice); on the Iris Xe 0x200 fails as a compared case and the two 0x400 cases throughrecorded.Host runtime 1.620.2: the probe gets the same answers as on 1.618.5 for the three cases on all three adapters. The test itself stops earlier there, at
allocation_mismatches(among others a resource flag 0x1000 that this runtime accepts), which is also unrelated to this change.python -I scripts/check_no_game_data.py runtime/test/d3d12_vulkan_device_test.cpp: clean.ctest(only this test was built), an up-to-date in-box Windows 11 runtime, Windows 10, Windows 11 23H2, AMD, Linux and Wine (the comparison is skipped without a Microsoft host).GPUs tested: Intel Iris Xe (Raptor Lake-P, 8086:a7a0), Intel 32.0.101.7092, Windows 11 build 26100.6584; NVIDIA GeForce RTX 4060 Laptop GPU, NVIDIA 621.40, Windows 11 build 26100.6584
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (not a translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.