Browse Source

*TimestampQueryPool: Fix `frame` property reference - https://github.com/mrdoob/three.js/issues/31869

sunag 3 months ago
parent
commit
3e8df0a1ce

+ 1 - 1
src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js

@@ -244,7 +244,7 @@ class WebGLTimestampQueryPool extends TimestampQueryPool {
 			}
 			}
 
 
 			// Return the total duration of the last frame
 			// Return the total duration of the last frame
-			const totalDuration = framesDuration[ this.frames[ this.frames.length - 1 ] ];
+			const totalDuration = framesDuration[ frames[ frames.length - 1 ] ];
 
 
 			// Store the last valid result
 			// Store the last valid result
 			this.lastValue = totalDuration;
 			this.lastValue = totalDuration;

+ 1 - 1
src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js

@@ -209,7 +209,7 @@ class WebGPUTimestampQueryPool extends TimestampQueryPool {
 			}
 			}
 
 
 			// Return the total duration of the last frame
 			// Return the total duration of the last frame
-			const totalDuration = framesDuration[ this.frames[ this.frames.length - 1 ] ];
+			const totalDuration = framesDuration[ frames[ frames.length - 1 ] ];
 
 
 			this.resultBuffer.unmap();
 			this.resultBuffer.unmap();
 			this.lastValue = totalDuration;
 			this.lastValue = totalDuration;

粤ICP备19079148号