Skip to content

Commit

Permalink
Fix false positive assert in debugCheckDivergingTransition
Browse files Browse the repository at this point in the history
  • Loading branch information
darksylinc committed Mar 5, 2024
1 parent 6d0ac67 commit 9889025
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions OgreMain/src/OgreResourceTransition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,24 @@ namespace Ogre
{
// The layout the texture is currently in does not match our records.
// This can mean either of two things:
// 1. Texture was transitioned outside BarrierSolver's knowledge
// 1. Texture was transitioned outside BarrierSolver's knowledge.
// This is wrong and bConsistentOldRecord = false.
//
// 2. User called resolveTransition() twice on this texture
// without executing the transition yet. Thus 'lastKnownLayout'
// contains the layout we will transition to. So we need
// to check the current layout matches the *old* record,
// not the future one.
// That's what we're checking here.
// This is allowed and that's what we're checking here.
// bConsistentOldRecord = true in this case.
bConsistentOldRecord = renderSystem->isSameLayout(
itor->oldLayout, texture->getCurrentLayout(), texture, true );

// Discardable textures will return whatever in texture->getCurrentLayout(), but
// itor->oldLayout will be ResourceLayout::Undefined if last time resolveTransition()
// was called was in a new frame. We need to allow this.
if( texture->isDiscardableContent() && itor->oldLayout == ResourceLayout::Undefined )
bConsistentOldRecord = true;
}
}

Expand Down

0 comments on commit 9889025

Please sign in to comment.