Skip to content

Commit

Permalink
Fix potential crash when setting a datablock to have no textures
Browse files Browse the repository at this point in the history
As a precondition, the datablock must've had textures before, the
datablock ended up fully loaded and baked with textures, and not be
running on OpenGL.
  • Loading branch information
darksylinc committed Feb 18, 2024
1 parent fbbea6c commit 2b6d5b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Components/Hlms/Common/include/OgreHlmsTextureBaseClass.inl
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,15 @@ namespace Ogre
else if( !mSamplersDescSet || *mSamplersDescSet != baseSampler )
{
if( mSamplersDescSet )
{
hlmsManager->destroyDescriptorSetSampler( mSamplersDescSet );
mSamplersDescSet = hlmsManager->getDescriptorSetSampler( baseSampler );
needsRecalculateHash = true;
mSamplersDescSet = 0;
}
if( !baseSampler.mSamplers.empty() )
{
mSamplersDescSet = hlmsManager->getDescriptorSetSampler( baseSampler );
needsRecalculateHash = true;
}
}

return needsRecalculateHash;
Expand Down

0 comments on commit 2b6d5b0

Please sign in to comment.