Skip to content

Commit df639a8

Browse files
committed
WebGPU: Align to vulkan impl - Don't update pInlineConstantData in InitInlineConstantBuffer because it has already been available since InitializeResources.
1 parent 3493041 commit df639a8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Graphics/GraphicsEngineWebGPU/include/ShaderResourceCacheWebGPU.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class ShaderResourceCacheWebGPU : public ShaderResourceCacheBase
9696
/*16 */ Uint64 BufferBaseOffset = 0;
9797
/*24 */ Uint64 BufferRangeSize = 0;
9898
// For inline constant buffers only - points to staging data in cache tail
99-
/*32 */ void* pInlineConstantData = nullptr;
99+
/*32 */ void* const pInlineConstantData = nullptr;
100100
// clang-format on
101101

102102
void SetUniformBuffer(RefCntAutoPtr<IDeviceObject>&& _pBuffer, Uint64 _RangeOffset, Uint64 _RangeSize);

Graphics/GraphicsEngineWebGPU/src/ShaderResourceCacheWebGPU.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,8 @@ void ShaderResourceCacheWebGPU::InitInlineConstantBuffer(Uint32 BindGrou
618618
VERIFY_EXPR(Res.Type == BindGroupEntryType::UniformBuffer ||
619619
Res.Type == BindGroupEntryType::UniformBufferDynamic);
620620

621-
// Set the pInlineConstantData pointer to point into the staging area
622-
Res.pInlineConstantData = m_pInlineConstantData + InlineConstantOffset;
621+
// Inline constant staging pointer must be initialized in InitializeResources().
622+
VERIFY_EXPR(Res.pInlineConstantData == static_cast<void*>(m_pInlineConstantData + InlineConstantOffset));
623623

624624
// Bind the emulation buffer as a uniform buffer
625625
// Use full buffer size (NumConstants * sizeof(Uint32))

0 commit comments

Comments
 (0)