Fix the camera's projection matrix when copying it from the previous frame 77/265577/4
authorRichard Huang <r.huang@samsung.com>
Fri, 22 Oct 2021 10:14:49 +0000 (11:14 +0100)
committerRichard <r.huang@samsung.com>
Thu, 18 Nov 2021 16:10:23 +0000 (16:10 +0000)
Change-Id: Ic189b49d2bd824e5ad8802396bd26b5224701dc2

dali/internal/update/render-tasks/scene-graph-camera.cpp

index 02400f3..5d3bab8 100644 (file)
@@ -601,10 +601,15 @@ uint32_t Camera::UpdateProjection(BufferIndex updateBufferIndex)
   // Early-exit if no update required
   if(0u != mUpdateProjectionFlag)
   {
+    Matrix& finalProjection = mFinalProjection[updateBufferIndex];
+    finalProjection.SetIdentity();
+
     if(COPY_PREVIOUS_MATRIX == mUpdateProjectionFlag)
     {
       // The projection matrix was updated in the previous frame; copy it
       mProjectionMatrix.CopyPrevious(updateBufferIndex);
+
+      finalProjection = mProjectionMatrix[updateBufferIndex];
     }
     else // UPDATE_COUNT == mUpdateProjectionFlag
     {
@@ -664,9 +669,6 @@ uint32_t Camera::UpdateProjection(BufferIndex updateBufferIndex)
 
       mProjectionMatrix.SetDirty(updateBufferIndex);
 
-      Matrix& finalProjection = mFinalProjection[updateBufferIndex];
-      finalProjection.SetIdentity();
-
       Quaternion rotationAngle;
       switch(mProjectionRotation)
       {