Repository navigation
d3d12: answer CheckFeatureSupport(MULTISAMPLE_QUALITY_LEVELS) as the host does - #2662
Conversation
CheckFeatureSupport(MULTISAMPLE_QUALITY_LEVELS) refused the TILED_RESOURCE flag with E_INVALIDARG. Native D3D12 (RX 7800 XT, a Radeon iGPU and WARP) answers S_OK: 1x and 4x keep the plain answer, every other count has none, and a format without a tile shape (96-bit) has none at any count, which is GetResourceAllocationInfo's tiled rule here (tiled MSAA is 4x only). 128-bit formats tiled at 4x are a driver difference: the AMD drivers answer 0, WARP and NVIDIA allocate them; the layer follows the latter. d3d12_vulkan_device_test compares the TILED_RESOURCE quality levels of six formats at five counts with the host's (allowing that one difference). The allocation side of the AMD failure is c97ae26's host-quality gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow RTX 5070 / 621.14 measurements from upstream ItsNotRexed#1991; preserve tiled-resource rules and cover host answers synthetically. AI-assisted. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Independent Windows test of I also compared the Vulkan device with native D3D12 using format IDs 0–192, sample counts 0–33 and flag words 0–3, with A local control rejected |
|
@jaybeebabageyus sorry, I missed your D3D-312 claim on #313 when opening this. Happy for you to review this or take it over; if you'd rather write your own, say so and I'll close it. |
…ALITY_LEVELS; fix flag type name Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
kacper-serewis
left a comment
There was a problem hiding this comment.
Follow-up on the R16G16_SNORM untiled 4× discrepancy. On an RTX 5070, Windows driver 616.56, native CheckFeatureSupport returned S_OK and one level. CreateCommittedResource also returned S_OK for a 64×64 default-heap render target, one mip, quality 0. For VK_FORMAT_R16G16_SNORM, vkGetPhysicalDeviceImageFormatProperties returned VK_SUCCESS and sampleCounts 0xf (1/2/4/8) with the PR’s 2D optimal tiling, transfer src/dst + sampled + color attachment usages, and zero create flags. RGBA8_UNORM gave the same three results as a control. At eac6e0c the storage-format switch lacks the SNORM mapping, which explains the previously reported zero without invoking a driver limitation. Commit 629bcb2 already adds that mapping in the newer tree. Recheck this case after updating the base. Synthetic probe, no game files. No pipeline or rebased shim run in this measurement.
|
Retested the revised head |
|
@duudiis Thanks for the Windows run. 9055527 fixes the type name to D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS and rejects R1_UNORM with the unknown formats. A rejected format now returns E_FAIL with the caller's NumQualityLevels untouched, and a known format clears it to 0 before the count check. The test now covers {R8G8B8A8, 0} → (E_FAIL, 0) and {192, 0} → (E_FAIL, 99). I left the 150 differing level counts (tiled NV12 at ×1, R16G16_SNORM at ×4) alone, since you found they depend on the driver. Would you re-run the device test on 9055527? AI-assisted (Devin). |
|
Keep it open � you carry it forward. I compared per the coordinator's ask above: your branch implements the full host-behavior table (validation order, R1_UNORM and unknown-format output handling, the tiled rule) with a synthetic test, stacked on #1991, and my claim at 17:31 had only a work-in-progress test and no PR � so my test diff is withdrawn and #2662 carries D3D-312 forward. Two notes from the thread, both already covered on the current head: the eac6e0c compile error from the independent test above (the I am running the current head on an RTX 3060 (Ampere, Windows 11, driver 32.0.16.1088) for a second GPU data point and will report here. AI-assisted. |
|
Independent validation of the head (
One nit from the build log: MSVC C4456 � |
|
Independent, AI-assisted retest of ccc7cf8f after merging main. The runtime library and stock d3d12_vulkan_device_test target compiled and linked on Windows 11 build 26200 with MSVC 19.38.33145 x64, Windows SDK 10.0.26100.0 and Vulkan SDK 1.4.363.0. I ran only the capability-query harness. Adding same-adapter native results for Radeon and RTX 3080 to the RTX 3060 report. I compared 112 valid MULTISAMPLE_QUALITY_LEVELS queries per adapter against native D3D12 on the same LUID, using 14 formats, counts 1/2/4/8 and NONE and TILED_RESOURCE. Both sides returned S_OK throughout. Each run used one native Vulkan ICD, an empty implicit-layer path, and Khronos validation with zero diagnostics.
Every remaining difference reproduced with the same values on #1991. Both adapters returned native 0 versus layer 1 for tiled D24_UNORM_S8_UINT at 1x and 4x, and native 1 versus layer 0 for A8_UNORM at untiled 2x/4x/8x and tiled 4x. Radeon also reproduced #1991's documented tiled R32G32B32A32_FLOAT 4x result (native 0, layer 1). The 1x BC1/BC7 improvements held on both adapters under both flags. The harness used valid queries only and created no test resources. Exact query code |
…C4456) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Claimed in the coordination issue as: claiming: @dev-ewann's 17:21 finding in #2516 — CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS) answers as the host does (out-of-range SampleCount E_FAIL, unsupported in-range count S_OK with 0 levels, ×1 = 1 level for every known format, unknown format E_FAIL, undefined Flags bits same as none). Depends on: #1991. Synthetic test, no game files. AI-assisted (Devin).
(Claim posted here because this account can't comment on the coordination issue.)
Stacked on #1991: this branch contains #1991's commits, so review only the top commit until #1991 merges.
Depends on: #1991
What and why
CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS)now answers as the host runtime does (measured by @dev-ewann on an RTX 5070 / 621.14, reported in #2516):SampleCount0 or above 32E_FAILE_INVALIDARGS_OK, 0 levelsE_INVALIDARGUNKNOWN, BC, B4G4R4A4, sampler feedback)S_OK, 1 levelDXGI_ERROR_UNSUPPORTEDor 0E_FAILDXGI_ERROR_UNSUPPORTEDFlagsbitsE_INVALIDARGWrong struct size stays
E_INVALIDARG. #1991'sTILED_RESOURCErules are kept (tiled 96-bit formats have no levels, also at ×1).runtime/test/d3d12_vulkan_device_test.cppchecks these answers on our device alone (no host device needed): every format value 0–192 at ×1/×3/×31, invalid counts, undefined flag bits with and withoutTILED_RESOURCE, and wrong sizes.Tested
Not built or run locally: no Windows/MSVC or Vulkan GPU on the machine this was written on, so CI's Windows build and the Wine/llvmpipe run are the first check. A run on Windows + any Vulkan GPU is welcome. AI-assisted (Devin).
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)