Skip to content

Commit 1307ba8

Browse files
committed
Fix m_HasInlineConstant not set when PRS restored from Render State Cache.
1 parent 869683a commit 1307ba8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ class ShaderResourceCacheVk : public ShaderResourceCacheBase
303303
}
304304
}
305305

306+
// Explicitly marks that this cache contains inline constants.
307+
// This is useful when inline constant memory is initialized externally
308+
// (e.g., during SRB cache setup) before any data is written.
309+
void MarkHasInlineConstants()
310+
{
311+
m_HasInlineConstants = 1;
312+
}
313+
306314
Uint32 GetNumPushConstantBuffers() const { return m_NumPushConstantBuffers; }
307315

308316
Uint32 GetNumDescriptorSets() const { return m_NumSets; }

Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,10 @@ void PipelineResourceSignatureVkImpl::InitSRBResourceCache(ShaderResourceCacheVk
684684
// For emulated inline constants, data is stored in the descriptor set resources
685685
if (m_NumInlineConstantBuffers > 0)
686686
{
687+
// Ensure the cache reports inline constants so DeviceContextVkImpl
688+
// updates emulated buffers even if no data has been written yet.
689+
ResourceCache.MarkHasInlineConstants();
690+
687691
// Count push constant buffers and calculate total memory size
688692
Uint32 NumPushConstantBuffers = 0;
689693
Uint32 TotalInlineConstantSize = 0;

0 commit comments

Comments
 (0)