Skip to content

Commit

Permalink
HnMaterial: a couple of minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Nov 24, 2024
1 parent b249bae commit 6ce3727
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Hydrogent/src/HnMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ void HnMaterial::AllocateBufferSpace(HnRenderDelegate& RenderDelegate)

m_PSOFlags = HnRenderPass::GetMaterialPSOFlags(*this);
Uint32 AttribsSize = UsdRenderer.GetPBRMaterialAttribsSize(m_PSOFlags);
if (m_PBRMaterialAttribsBufferOffset == ~0u || AttribsSize > m_PBRMaterialAttribsSize)
if (m_PBRMaterialAttribsBufferOffset == ~0u || AttribsSize != m_PBRMaterialAttribsSize)
{
if (!m_SRBCache)
{
Expand Down Expand Up @@ -1363,7 +1363,10 @@ void HnMaterial::EndResourceUpdate(HnRenderDelegate& RenderDelegate)

HnMaterial::~HnMaterial()
{
m_SRBCache->AllocateBufferOffset(m_PBRMaterialAttribsBufferOffset, m_PBRMaterialAttribsSize, 0);
if (m_SRBCache)
{
m_SRBCache->AllocateBufferOffset(m_PBRMaterialAttribsBufferOffset, m_PBRMaterialAttribsSize, 0);
}
}

} // namespace USD
Expand Down

0 comments on commit 6ce3727

Please sign in to comment.