@@ -949,7 +949,6 @@ function WebGLExtensions(gl) {
949949 getExtension ( "EXT_color_buffer_float" ) ;
950950 getExtension ( "OES_texture_float_linear" ) ;
951951 getExtension ( "EXT_color_buffer_half_float" ) ;
952- getExtension ( "WEBGL_multisampled_render_to_texture" ) ;
953952 } ,
954953 get ( name ) {
955954 const extension = getExtension ( name ) ;
@@ -4999,7 +4998,7 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
49994998 const maxCubemapSize = capabilities . maxCubemapSize ;
50004999 const maxTextureSize = capabilities . maxTextureSize ;
50015000 const maxSamples = capabilities . maxSamples ;
5002- const multisampledRTTExt = extensions . has ( "WEBGL_multisampled_render_to_texture" ) ? extensions . get ( "WEBGL_multisampled_render_to_texture" ) : null ;
5001+ extensions . has ( "WEBGL_multisampled_render_to_texture" ) ? extensions . get ( "WEBGL_multisampled_render_to_texture" ) : null ;
50035002 const supportsInvalidateFramebuffer = typeof navigator === "undefined" ? false : / O c u l u s B r o w s e r / g. test ( navigator . userAgent ) ;
50045003 const _videoTextures = /* @__PURE__ */ new WeakMap ( ) ;
50055004 let _canvas ;
@@ -6141,16 +6140,7 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
61416140 }
61426141 }
61436142 state . bindFramebuffer ( _gl . FRAMEBUFFER , framebuffer ) ;
6144- if ( useMultisampledRTT ( renderTarget ) ) {
6145- multisampledRTTExt . framebufferTexture2DMultisampleEXT (
6146- _gl . FRAMEBUFFER ,
6147- attachment ,
6148- textureTarget ,
6149- properties . get ( texture ) . __webglTexture ,
6150- 0 ,
6151- getRenderTargetSamples ( renderTarget )
6152- ) ;
6153- } else if ( textureTarget === _gl . TEXTURE_2D || textureTarget >= _gl . TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl . TEXTURE_CUBE_MAP_NEGATIVE_Z ) {
6143+ if ( textureTarget === _gl . TEXTURE_2D || textureTarget >= _gl . TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl . TEXTURE_CUBE_MAP_NEGATIVE_Z ) {
61546144 _gl . framebufferTexture2D (
61556145 _gl . FRAMEBUFFER ,
61566146 attachment ,
@@ -6165,7 +6155,7 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
61656155 _gl . bindRenderbuffer ( _gl . RENDERBUFFER , renderbuffer ) ;
61666156 if ( renderTarget . depthBuffer && ! renderTarget . stencilBuffer ) {
61676157 let glInternalFormat = _gl . DEPTH_COMPONENT32F ;
6168- if ( isMultisample || useMultisampledRTT ( renderTarget ) ) {
6158+ if ( isMultisample ) {
61696159 const depthTexture = renderTarget . depthTexture ;
61706160 if ( depthTexture && depthTexture . isDepthTexture ) {
61716161 if ( depthTexture . type === FloatType ) {
@@ -6175,23 +6165,13 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
61756165 }
61766166 }
61776167 const samples = getRenderTargetSamples ( renderTarget ) ;
6178- if ( useMultisampledRTT ( renderTarget ) ) {
6179- multisampledRTTExt . renderbufferStorageMultisampleEXT (
6180- _gl . RENDERBUFFER ,
6181- samples ,
6182- glInternalFormat ,
6183- renderTarget . width ,
6184- renderTarget . height
6185- ) ;
6186- } else {
6187- _gl . renderbufferStorageMultisample (
6188- _gl . RENDERBUFFER ,
6189- samples ,
6190- glInternalFormat ,
6191- renderTarget . width ,
6192- renderTarget . height
6193- ) ;
6194- }
6168+ _gl . renderbufferStorageMultisample (
6169+ _gl . RENDERBUFFER ,
6170+ samples ,
6171+ glInternalFormat ,
6172+ renderTarget . width ,
6173+ renderTarget . height
6174+ ) ;
61956175 } else {
61966176 _gl . renderbufferStorage (
61976177 _gl . RENDERBUFFER ,
@@ -6208,22 +6188,14 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
62086188 ) ;
62096189 } else if ( renderTarget . depthBuffer && renderTarget . stencilBuffer ) {
62106190 const samples = getRenderTargetSamples ( renderTarget ) ;
6211- if ( isMultisample && useMultisampledRTT ( renderTarget ) === false ) {
6191+ if ( isMultisample ) {
62126192 _gl . renderbufferStorageMultisample (
62136193 _gl . RENDERBUFFER ,
62146194 samples ,
62156195 _gl . DEPTH24_STENCIL8 ,
62166196 renderTarget . width ,
62176197 renderTarget . height
62186198 ) ;
6219- } else if ( useMultisampledRTT ( renderTarget ) ) {
6220- multisampledRTTExt . renderbufferStorageMultisampleEXT (
6221- _gl . RENDERBUFFER ,
6222- samples ,
6223- _gl . DEPTH24_STENCIL8 ,
6224- renderTarget . width ,
6225- renderTarget . height
6226- ) ;
62276199 } else {
62286200 _gl . renderbufferStorage (
62296201 _gl . RENDERBUFFER ,
@@ -6250,22 +6222,14 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
62506222 texture . colorSpace
62516223 ) ;
62526224 const samples = getRenderTargetSamples ( renderTarget ) ;
6253- if ( isMultisample && useMultisampledRTT ( renderTarget ) === false ) {
6225+ if ( isMultisample ) {
62546226 _gl . renderbufferStorageMultisample (
62556227 _gl . RENDERBUFFER ,
62566228 samples ,
62576229 glInternalFormat ,
62586230 renderTarget . width ,
62596231 renderTarget . height
62606232 ) ;
6261- } else if ( useMultisampledRTT ( renderTarget ) ) {
6262- multisampledRTTExt . renderbufferStorageMultisampleEXT (
6263- _gl . RENDERBUFFER ,
6264- samples ,
6265- glInternalFormat ,
6266- renderTarget . width ,
6267- renderTarget . height
6268- ) ;
62696233 } else {
62706234 _gl . renderbufferStorage (
62716235 _gl . RENDERBUFFER ,
@@ -6293,45 +6257,23 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
62936257 }
62946258 setTexture2D ( renderTarget . depthTexture , 0 ) ;
62956259 const webglDepthTexture = properties . get ( renderTarget . depthTexture ) . __webglTexture ;
6296- const samples = getRenderTargetSamples ( renderTarget ) ;
6260+ getRenderTargetSamples ( renderTarget ) ;
62976261 if ( renderTarget . depthTexture . format === DepthFormat ) {
6298- if ( useMultisampledRTT ( renderTarget ) ) {
6299- multisampledRTTExt . framebufferTexture2DMultisampleEXT (
6300- _gl . FRAMEBUFFER ,
6301- _gl . DEPTH_ATTACHMENT ,
6302- _gl . TEXTURE_2D ,
6303- webglDepthTexture ,
6304- 0 ,
6305- samples
6306- ) ;
6307- } else {
6308- _gl . framebufferTexture2D (
6309- _gl . FRAMEBUFFER ,
6310- _gl . DEPTH_ATTACHMENT ,
6311- _gl . TEXTURE_2D ,
6312- webglDepthTexture ,
6313- 0
6314- ) ;
6315- }
6262+ _gl . framebufferTexture2D (
6263+ _gl . FRAMEBUFFER ,
6264+ _gl . DEPTH_ATTACHMENT ,
6265+ _gl . TEXTURE_2D ,
6266+ webglDepthTexture ,
6267+ 0
6268+ ) ;
63166269 } else if ( renderTarget . depthTexture . format === DepthStencilFormat ) {
6317- if ( useMultisampledRTT ( renderTarget ) ) {
6318- multisampledRTTExt . framebufferTexture2DMultisampleEXT (
6319- _gl . FRAMEBUFFER ,
6320- _gl . DEPTH_STENCIL_ATTACHMENT ,
6321- _gl . TEXTURE_2D ,
6322- webglDepthTexture ,
6323- 0 ,
6324- samples
6325- ) ;
6326- } else {
6327- _gl . framebufferTexture2D (
6328- _gl . FRAMEBUFFER ,
6329- _gl . DEPTH_STENCIL_ATTACHMENT ,
6330- _gl . TEXTURE_2D ,
6331- webglDepthTexture ,
6332- 0
6333- ) ;
6334- }
6270+ _gl . framebufferTexture2D (
6271+ _gl . FRAMEBUFFER ,
6272+ _gl . DEPTH_STENCIL_ATTACHMENT ,
6273+ _gl . TEXTURE_2D ,
6274+ webglDepthTexture ,
6275+ 0
6276+ ) ;
63356277 } else {
63366278 throw new Error ( "Unknown depthTexture format" ) ;
63376279 }
@@ -6431,7 +6373,7 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
64316373 ) ;
64326374 }
64336375 }
6434- if ( renderTarget . samples > 0 && useMultisampledRTT ( renderTarget ) === false ) {
6376+ if ( renderTarget . samples > 0 ) {
64356377 const textures = isMultipleRenderTargets ? texture : [ texture ] ;
64366378 renderTargetProperties . __webglMultisampledFramebuffer = _gl . createFramebuffer ( ) ;
64376379 renderTargetProperties . __webglColorRenderbuffer = [ ] ;
@@ -6584,7 +6526,7 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
65846526 }
65856527 }
65866528 function updateMultisampleRenderTarget ( renderTarget ) {
6587- if ( renderTarget . samples > 0 && useMultisampledRTT ( renderTarget ) === false ) {
6529+ if ( renderTarget . samples > 0 ) {
65886530 const textures = renderTarget . isWebGLMultipleRenderTargets ? renderTarget . texture : [ renderTarget . texture ] ;
65896531 const width = renderTarget . width ;
65906532 const height = renderTarget . height ;
@@ -6693,10 +6635,6 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
66936635 function getRenderTargetSamples ( renderTarget ) {
66946636 return Math . min ( maxSamples , renderTarget . samples ) ;
66956637 }
6696- function useMultisampledRTT ( renderTarget ) {
6697- const renderTargetProperties = properties . get ( renderTarget ) ;
6698- return renderTarget . samples > 0 && extensions . has ( "WEBGL_multisampled_render_to_texture" ) === true && renderTargetProperties . __useRenderToTexture !== false ;
6699- }
67006638 function updateVideoTexture ( texture ) {
67016639 const frame = info . render . frame ;
67026640 if ( _videoTextures . get ( texture ) !== frame ) {
@@ -6735,7 +6673,6 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
67356673 this . updateMultisampleRenderTarget = updateMultisampleRenderTarget ;
67366674 this . setupDepthRenderbuffer = setupDepthRenderbuffer ;
67376675 this . setupFrameBufferTexture = setupFrameBufferTexture ;
6738- this . useMultisampledRTT = useMultisampledRTT ;
67396676}
67406677
67416678function WebGLUniformsGroups ( gl , info , capabilities , state ) {
0 commit comments