Commit Graph

3 Commits

Author SHA1 Message Date
59bb784066 d3d12_shader_cache_test: avoid passing nullptr to SAL _In_ params on host D3D12 runtime
Windows 11 23H2 in-box d3d12.dll (10.0.22621.5415) AVs with 0xC0000005 when passed nullptr for SAL _In_/_Inout_ parameters (pDesc, pKey, pValue, pValueSize) without the debug layer (reported by @CharlyRien on #2167). Keep all null-pointer checks on the Vulkan layer, skip only raw nullptr _In_/_Inout_ calls on the host comparison, and disable stdout buffering so progress lines flush immediately.
2026-11-22 19:57:44 +01:00
e8602fdfae runtime: address shader-cache session review feedback (D3D-34 follow-up)
Follow-up on merged 2d848a33 (#2167) addressing @Flyander's 7 review items:
1. Enforce version mismatch on live sessions (DXGI_ERROR_ALREADY_EXISTS) and clear+recreate on reopen after all sessions close.
2. Discard MODE_MEMORY stores on final release (in-memory sessions do not persist across full teardown).
3. Return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE on FindValue/StoreValue while ShaderCacheControl DISABLE is active.
4. Make ShaderCacheControl CLEAR remove inactive default-directory disk cache files left by prior runs.
5. Bound disk-file deserialization against actual file_size and max_file_bytes before allocating or reading.
6. Apply documented zero-limit defaults (1 KiB value, 128 entries, 128 MiB file) and return DXGI_ERROR_CACHE_FULL when limits are exceeded.
7. Use unique per-writer temp filenames (<pid>.<tid>.<seq>.tmp) for atomic disk flushes.

Verified on Windows 11 + NVIDIA GeForce RTX 3060 (621.24, Vulkan 1.4.357, LEONIDA_VK_VALIDATION=1): d3d12_shader_cache_test passed (0 validation errors).
2026-11-22 19:11:35 +01:00
cfcc6c54a3 runtime: implement ID3D12Device9::CreateShaderCacheSession and ShaderCacheControl (D3D-34)
Add in-memory ID3D12ShaderCacheSession support (FindValue, StoreValue, SetDeleteOnDestroy, GetDesc) and ID3D12Device9::ShaderCacheControl on the Vulkan-backed D3D12 device, matching the Windows D3D12 host runtime's validation, size queries, duplicate rejection, cross-session sharing, and delete-on-destroy lifecycle.

Verified with synthetic test d3d12_shader_cache_test comparing the Vulkan layer against the host Windows D3D12 runtime under LEONIDA_VK_VALIDATION=1.
2026-11-22 17:24:30 +01:00