Repository navigation
D3D-86: answer SHADER_MODEL and ROOT_SIGNATURE in CheckFeatureSupport - #704
Conversation
CheckFeatureSupport fell through to E_INVALIDARG for D3D12_FEATURE_SHADER_MODEL and D3D12_FEATURE_ROOT_SIGNATURE, so a game asking either got an error where the PC runtime answers. Report DXIL 1.0 and root signature 1.1, the versions this layer can honour rather than the driver's maximum, clamp higher requests down, and refuse an undefined value, a wrong DataSize and a null buffer, as the host runtime does.
|
On
Could you handle 5.1 and include it in the host comparison? The 6.0 ceiling still permits returning 5.1 to a caller that requested it. The Microsoft feature-support helper includes this query in its fallback list. AI-assisted, GitHub-hosted Windows Server 2022, Microsoft Basic Render Driver and Mesa llvmpipe. Hosted results · Microsoft helper. |
D3D12's baseline is 5.1, and both WARP and the RTX 5070 runtime answer a 5.1 request with S_OK and 5.1; the layer refused everything below 6.0, so a caller asking for the minimum got E_INVALIDARG. The host comparison now covers 5.1, the test pins it, and the docs record both measurements.
|
Thanks, that is a real divergence and it reproduces here. On the RTX 5070 (driver 616.86), Fixed in the follow-up commit: 5.1 is now echoed, a value below 5.1 is still Test run after the change: |
|
Tested
PR head as-is, no game files. AI-assisted. |
|
Tested e4d7234 on NVIDIA GeForce RTX 3060, driver 596.36, Windows 10 Pro 19045: fail on a Windows 10 host, in the new This is the failure @Proudnoob4 has since claimed and @etcetera-yt reported in #634, so this is a third Windows 10 machine with the same four lines (shader model 0x67 to 0x69 and root signature 0x3: the layer clamps, the host refuses). What I can add is the full table of host answers, measured with a small host-only probe (plain
One detail that matters for the fix: this runtime's own maximum is 6.5, and it still accepts a 6.6 request and clamps it. So "the highest request the host answered" is 6.6 here, one above its maximum, and the refusals start at 6.7. What was run:
Build: MSVC 19.44 (VS 2022 Build Tools 17.14), Windows SDK 10.0.26100, Vulkan SDK 1.4.363, CMake + Ninja, RelWithDebInfo. No game files. AI-assisted (Claude Code), run on my own machine. Repository test programs and one host-only probe. |
…ainst the layer's clamp Windows 10's d3d12.dll refuses shader models 6.7-6.9 and root signature 1.2 with E_INVALIDARG, where a newer runtime clamps them, so the SHADER_MODEL / ROOT_SIGNATURE comparison from #704 counted 4 mismatches on every Windows 10 machine. A request above the highest one the host answered is now checked against the layer's own clamp (S_OK, 6.0 / 1.1) instead, and the count is printed.
Item: D3D-86 (see #634). This closes the
SHADER_MODELandROOT_SIGNATUREgroups; FORMAT_INFO is @cemalyakla's, and theD3D12_OPTIONSfamilies (OPTIONS1–5, 7–9, 11–16, 18) are untouched and still open.What changed
CheckFeatureSupportanswered both queries withE_INVALIDARGfrom itsdefault:arm, so a game asking for either got an error where the PC runtime answers.D3D12_FEATURE_SHADER_MODEL: answered as 6.0 (DXIL 1.0), not the driver's maximum. Nothing in the runtime compiles DXIL — the game's shaders arrive as SPIR-V from the offline translator, and the only DXIL path (the BVH builder) is lowered to standard DXIL, whose baseline is 6.0. A request above it is clamped down to 6.0. Answering 6.8 because the NVIDIA driver does would invite shaders this layer has no front end for, which is the failure mode section 4.1 already describes as worse than a false "unsupported".D3D12_FEATURE_ROOT_SIGNATURE: answered as 1.1, the version the proxy can always produce. 1.2 blobs are rewritten as 1.1 when the host serializer stops at 1.1 and nothing is lost (d3d12_xs_rootsig.cpp), and Windows 10'sd3d12.dllstops there, so 1.1 is what the game can rely on on every supported host. A higher request is clamped down.DataSize, a null buffer, and an undefined enum value areE_INVALIDARG.runtime/test/d3d12_vulkan_device_test.cppgainscompare_feature_support, which uses the same host-device oracle as the existingGetCopyableFootprintscomparison (every defined request is sent to both devices and the HRESULTs must match, with the value clamped to the layer's ceiling), plus explicit assertions pinning the ceiling and each refusal case.docs/d3d12_vulkan.mdsection 3 and section 4.1 record the answers and the measurements.Measured against the host PC runtime (616.86)
S_OK, echoes the requestS_OK, clamped to 6.80E_INVALIDARGS_OK, echoes the requestDataSizeE_INVALIDARGTwo host behaviours the test deliberately does not reproduce: the host runtime crashed the process on an undefined shader model (
0x5f, and once on0) and on a nullpFeatureSupportDataforROOT_SIGNATURE. The layer refuses those withE_INVALIDARGinstead, and only values the runtime defines are ever sent to the host, so the test cannot take it down.Tested
d3d12_vulkan_device_teston Windows 11, RTX 5070 (driver 616.86), Vulkan 1.4.351, MSVC 14.52,RelWithDebInfowith Ninja: exit 0, and 0 feature-query mismatches against the host device. The same test passed onmainbefore the change, and its existingGetCopyableFootprintsand allocation/footprint comparisons still match.No game files were used; the test builds its own resources and shaders-free comparisons, as before.
Depends on: none