comparisonKey fixed

This commit is contained in:
Uwe Rathmann 2023-12-28 16:37:13 +01:00
parent cb9b83bbca
commit 56b1ecf707
1 changed files with 12 additions and 1 deletions

View File

@ -314,7 +314,18 @@ class QskSceneTexturePrivate final : public QSGTexturePrivate
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
int comparisonKey() const override
{ return int( qintptr( rhiTexture() ) ); }
{
if ( renderer )
{
if ( renderer->textureId() )
return renderer->textureId();
if ( renderer->rhiTexture() )
return int( qintptr( renderer->rhiTexture() ) );
}
return int( qintptr( this ) );
}
QRhiTexture *rhiTexture() const override
{ return renderer ? renderer->rhiTexture() : nullptr; }