summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2021-04-27 11:12:33 +0300
committerAntti Määttä <antti.maatta@qt.io>2021-04-27 12:05:55 +0300
commit36121a1993664b79d4d709c9a9ee92b464cb859e (patch)
treee2549cf88c40535da71d1a1efd6ab780bcf9e022
parentda294d646d7f31855822b06f18ff5b061237eaa2 (diff)
Check subprentation texture change
Do not replace subresentation texture every tume and subsequently mark subpresentation as dirty each time. Add check if the texture has changed and replace it only when it has. Task-number: QT3DS-4228 Change-Id: Ie7bfe1ddaf6ab9d147585d4ccd266a4512ed8323 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/runtimerender/graphobjects/Qt3DSRenderImage.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtimerender/graphobjects/Qt3DSRenderImage.cpp b/src/runtimerender/graphobjects/Qt3DSRenderImage.cpp
index d4930ca..8b187f8 100644
--- a/src/runtimerender/graphobjects/Qt3DSRenderImage.cpp
+++ b/src/runtimerender/graphobjects/Qt3DSRenderImage.cpp
@@ -65,7 +65,8 @@ static void HandleOffscreenResult(SImage &theImage, SImageTextureData &newImage,
newImage.m_TextureFlags.SetPreMultiplied(theResult.m_HasTransparency);
wasDirty = wasDirty || theResult.m_HasChangedSinceLastFrame;
theImage.m_LastFrameOffscreenRenderer = theResult.m_Renderer;
- replaceTexture = true;
+ if (theImage.m_TextureData.m_Texture != theResult.m_Texture)
+ replaceTexture = true;
}
bool SImage::ClearDirty(IBufferManager &inBufferManager, IOffscreenRenderManager &inRenderManager,