@@ -66,6 +66,10 @@ export function defaultWindowResize (ppl: BasicPipeline, window: RenderWindow, w
66
66
ppl . addDepthStencil ( `ShadowDepth${ id } ` , Format . DEPTH_STENCIL , shadowSize . x , shadowSize . y ) ;
67
67
}
68
68
69
+ function getRenderWindowSize ( window : RenderWindow ) : [ number , number ] {
70
+ return [ Math . max ( Math . floor ( window . width ) , 1 ) , Math . max ( Math . floor ( window . height ) , 1 ) ] ;
71
+ }
72
+
69
73
// Map to store throttle timers by cameraId
70
74
const throttleTimers = new Map ( ) ;
71
75
// Map to store last resize time by cameraId
@@ -103,18 +107,16 @@ export function dispatchResizeEvents (cameras: Camera[], builder: PipelineBuilde
103
107
if ( isFrequentResizing && throttleTimers . has ( cameraId ) ) {
104
108
continue ;
105
109
}
106
-
107
- const width = Math . max ( Math . floor ( camera . window . width ) , 1 ) ;
108
- const height = Math . max ( Math . floor ( camera . window . height ) , 1 ) ;
109
-
110
110
if ( isFrequentResizing ) {
111
111
// Apply throttle only when frequent resizing is detected
112
112
throttleTimers . set ( cameraId , setTimeout ( ( ) => {
113
+ const [ width , height ] = getRenderWindowSize ( camera . window ) ;
113
114
builder . windowResize ! ( ppl , camera . window , camera , width , height ) ;
114
115
camera . window . setRenderWindowResizeHandled ( ) ;
115
116
throttleTimers . delete ( cameraId ) ;
116
117
} , THROTTLE_DELAY ) ) ;
117
118
} else {
119
+ const [ width , height ] = getRenderWindowSize ( camera . window ) ;
118
120
// Normal resize - execute immediately
119
121
builder . windowResize ( ppl , camera . window , camera , width , height ) ;
120
122
camera . window . setRenderWindowResizeHandled ( ) ;
0 commit comments