Repository navigation
Runtime: GetCachedBlob and CachedPSO checks like the host runtime - #1683
Conversation
|
Tested 3105f65 on RTX 4070 SUPER (NVIDIA 616.64) and Intel UHD 770 (101.7092), Windows 11, MSVC 19.44: pass
|
|
Tested
AI-assisted (Claude Code). Synthetic tests only, no game data. |
|
{"body": "## Independent code review and test of PR #1683 (D3D-191)\n\nCommit tested: 3105f65 (head of PR #1683, branch |
|
Tested 3105f65 on AMD Radeon RDNA2 iGPU (Ryzen 9 9950X3D, driver 26.10.1) and NVIDIA RTX 5080 (616.92), Windows 11, MSVC 19.4x + Ninja (RelWithDebInfo): pass Full runtime build of the PR head,
Remarks:
AI-assisted. |
|
Tested 3105f65 merged onto main a0acd33 on AMD Radeon RX 6600 (RDNA2, Navi 23, discrete), AMD proprietary 26.11.2 (Vulkan 1.4.315), Windows 11 Pro 10.0.26300: pass.
Nit: MSVC 19.44 gives one new warning from this PR, AI-assisted (Claude Code): it merged the PR, built it, ran the suites and wrote this comment. |
ID3D12PipelineState::GetCachedBlob returns a blob with the adapter, driver, pipelineCacheUUID and a SHA-256 of the description (without Flags; shaders keyed by their DXBC checksum), sealed by a checksum. Create{Compute,Graphics}PipelineState check a supplied CachedPSO before creating the PSO and answer as the PC runtime does, measured on an RTX 3060 and WARP. Rebased onto main (one commit). AI-assisted.
|
Rebased onto |
3105f65 to
9cc95bf
Compare
ProjectLeonida#1683's comparison expected Wine to have no host D3D12 device or no compiler. Wine has both (vkd3d and its d3dcompiler_47), but vkd3d's GetCachedBlob is a stub, so cached_pso_cases returned no answers for each host adapter and `host == layer` failed on every run (line 388; Apple M3 Max, CrossOver 26.3 / Wine 11 with MoltenVK 1.4.3). Like the other host comparisons (host_wine.h), it now skips under Wine and says why; the layer's own 11 answers are still checked against the expected list.
What and why
New D3D item, claim:
ID3D12PipelineState::GetCachedBlobwas a generated stub (E_NOTIMPL) andCachedPSOinCreateComputePipelineState/CreateGraphicsPipelineStatewas ignored. A title that saves its PSO blobs and passes them back on the next run got a failure from the first call and no validation on the second.runtime/src/cached_pso.h: the blob. It holds no pipeline (the PSO is still rebuilt from its descriptors, and D3D-34 / Runtime: use the Vulkan pipeline cache produced by the build (D3D-34) #367 keeps theVkPipelineCacheside): magic, version,vendorID,deviceID,driverVersion,pipelineCacheUUID, a SHA-256 of the description, and an FNV-1a checksum over everything before it.d3d12_vulkan_device.cpp:GetCachedBlobonPipelineState, a description key per PSO type (shaders, root signature content, stream output, blend, sample mask, rasterizer, depth-stencil, input layout, strip cut, topology type, RTV/DSV formats, sample desc, node mask; notFlags), the root signature now keeps the SHA-256 of its serialized blob, and theCachedPSOcheck runs before the PSO is created.docs/d3d12_vulkan.md§3.6: replaces "CachedPSO blobs are ignored" with what the layer does now.Host behaviour it follows
Measured with the PC runtime on an RTX 3060 (driver 32.0.16.1714, Windows 11) and WARP, compute and graphics:
FlagsCachedBlobSizeInBytes0D3D12_ERROR_ADAPTER_NOT_FOUNDGetCachedBlob(nullptr)Another driver gives
D3D12_ERROR_DRIVER_VERSION_MISMATCHper the DirectX docs; not measured (needs a driver change), the layer returns it for a differentdriverVersionorpipelineCacheUUID.Tested
d3d12_compute_test: the 11 cases above run on the layer and on the host (default adapter and WARP, emptycs_5_0shader fromd3dcompiler_47), and the answers must be equal (printscached PSO: 2 host adapter(s) gave the same 11 answers; skips the host half without a host device or compiler). Then every byte of the blob flipped one at a time gives E_INVALIDARG, and resealed vendor/device/driver/UUID/version changes give the errors above.d3d12_draw_test:GetCachedBlobon the graphics PSO and the graphics rows of the table.ctest(without the window testsd3d12_present,xbox_present,dxgi_swapchain,frame_pacer): 88/88 pass (package-gated tests skip), MSVC 19.51, Windows SDK 10.0.26100, Windows 11, NVIDIA GeForce RTX 3060, driver 32.0.16.1714. Not run under the Vulkan validation layers (not installed on this machine).No game files used.
AI-assisted (Claude).