|
@@ -2005,11 +2005,19 @@ export class Scene extends AbstractScene implements IAnimatable, IClipPlanesHold
|
|
*/
|
|
*/
|
|
public setTransformMatrix(viewL: Matrix, projectionL: Matrix, viewR?: Matrix, projectionR?: Matrix): void {
|
|
public setTransformMatrix(viewL: Matrix, projectionL: Matrix, viewR?: Matrix, projectionR?: Matrix): void {
|
|
if (ThinEngine.Features.trackUbosInFrame) {
|
|
if (ThinEngine.Features.trackUbosInFrame) {
|
|
|
|
+ const indexBufferBefore = this._sceneUbo._indexBuffer;
|
|
const viewLUpdateFlag = this._sceneUbo._getMatrixUpdateFlagFromCache("view");
|
|
const viewLUpdateFlag = this._sceneUbo._getMatrixUpdateFlagFromCache("view");
|
|
const projectionLUpdateFlag = this._sceneUbo._getMatrixUpdateFlagFromCache("projection");
|
|
const projectionLUpdateFlag = this._sceneUbo._getMatrixUpdateFlagFromCache("projection");
|
|
|
|
+ const indexBufferAfter = this._sceneUbo._indexBuffer;
|
|
|
|
|
|
if (viewLUpdateFlag === viewL.updateFlag && projectionLUpdateFlag === projectionL.updateFlag) {
|
|
if (viewLUpdateFlag === viewL.updateFlag && projectionLUpdateFlag === projectionL.updateFlag) {
|
|
- return;
|
|
|
|
|
|
+ if (indexBufferAfter === indexBufferBefore) {
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ // fall through
|
|
|
|
+ // indexBufferAfter !== indexBufferBefore means we have cycled to the first buffer (because of a frame id change): this buffer is in line with
|
|
|
|
+ // the matrices passed to setTransformMatrix but the matrices saved in the scene are (may) not (be) ok, we must update them
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else if (this._viewUpdateFlag === viewL.updateFlag && this._projectionUpdateFlag === projectionL.updateFlag) {
|
|
} else if (this._viewUpdateFlag === viewL.updateFlag && this._projectionUpdateFlag === projectionL.updateFlag) {
|
|
return;
|
|
return;
|