Repository navigation
Conversation
…y and context mask Archives do not store PipelineStateDesc::SRBAllocationGranularity and ImmediateContextMask; the dearchiver takes them from PipelineStateUnpackInfo. RenderStateCacheImpl left both at their defaults, so a pipeline created with other values never matched the one unpacked from a loaded cache: the cache logged a description mismatch and created the pipeline again. Add RenderStateCacheTest.ArchivedPSOKeepsDescription, which fails on Vulkan, D3D12, D3D11 and GL without the fix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…acked pipeline PipelineStateBase clears the bits of ImmediateContextMask that have no command queue on the device. A pipeline unpacked from the cache therefore may hold a subset of the requested mask, and comparing its description with the create info reported a mismatch and created the pipeline again. Compare with the requested mask reduced to the bits the pipeline kept. ArchivedPSOKeepsDescription now requests every context bit, so it covers the reduced mask on any device; it fails on Vulkan, D3D12, D3D11 and GL with only the previous commit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A pipeline created with a non-default
SRBAllocationGranularityorImmediateContextMaskwas never reused from a loaded render state cache. Every lookup logged:The cache then created the pipeline again, so a stored cache did not help these pipelines. Any pipeline that may run on several immediate contexts is affected. There are two causes:
PipelineStateDesc::SRBAllocationGranularityandImmediateContextMask(PSOSerializer.cpp:// skip SRBAllocationGranularity,// skip ImmediateContextMask). The dearchiver takes them fromPipelineStateUnpackInfoinstead.RenderStateCacheImpl::CreatePipelineStateInternaldid not fill these two fields, so they stayed at their defaults.PipelineStateBaseclears the bits ofImmediateContextMaskthat have no command queue on the device (m_Desc.ImmediateContextMask &= DeviceQueuesMask). Even with the right unpack info, the unpacked pipeline can hold a subset of the requested mask, and it was compared with the create info as is.Fix
SRBAllocationGranularityandImmediateContextMaskfrom the create info intoUnpackInfo.Test
New test
RenderStateCacheTest.ArchivedPSOKeepsDescription:SRBAllocationGranularity = 4andImmediateContextMask = ~0(not the default on any device, and always reduced by the device).Results (NVIDIA GeForce RTX 5060, Windows, x64 Debug):
RenderStateCacheTest.*tests pass or skip as before on all four.