Skip to content

Commit d82c645

Browse files
Mugen87donmccurdy
authored andcommitted
WebGLTextures: Remove render target texture fallback. (mrdoob#23470)
1 parent 0a26d56 commit d82c645

File tree

2 files changed

+4
-51
lines changed

2 files changed

+4
-51
lines changed

src/renderers/webgl/WebGLTextures.js

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,50 +1815,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
18151815

18161816
}
18171817

1818-
// backwards compatibility
1819-
1820-
let warnedTexture2D = false;
1821-
let warnedTextureCube = false;
1822-
1823-
function safeSetTexture2D( texture, slot ) {
1824-
1825-
if ( texture.isWebGLRenderTarget ) {
1826-
1827-
if ( warnedTexture2D === false ) {
1828-
1829-
console.warn( 'THREE.WebGLTextures.safeSetTexture2D: don\'t use render targets as textures. Use their .texture property instead.' );
1830-
warnedTexture2D = true;
1831-
1832-
}
1833-
1834-
texture = texture.texture;
1835-
1836-
}
1837-
1838-
setTexture2D( texture, slot );
1839-
1840-
}
1841-
1842-
function safeSetTextureCube( texture, slot ) {
1843-
1844-
if ( texture.isWebGLCubeRenderTarget ) {
1845-
1846-
if ( warnedTextureCube === false ) {
1847-
1848-
console.warn( 'THREE.WebGLTextures.safeSetTextureCube: don\'t use cube render targets as textures. Use their .texture property instead.' );
1849-
warnedTextureCube = true;
1850-
1851-
}
1852-
1853-
texture = texture.texture;
1854-
1855-
}
1856-
1857-
1858-
setTextureCube( texture, slot );
1859-
1860-
}
1861-
18621818
//
18631819

18641820
this.allocateTextureUnit = allocateTextureUnit;
@@ -1876,9 +1832,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
18761832
this.setupFrameBufferTexture = setupFrameBufferTexture;
18771833
this.useMultisampledRTT = useMultisampledRTT;
18781834

1879-
this.safeSetTexture2D = safeSetTexture2D;
1880-
this.safeSetTextureCube = safeSetTextureCube;
1881-
18821835
}
18831836

18841837
export { WebGLTextures };

src/renderers/webgl/WebGLUniforms.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ function setValueT1( gl, v, textures ) {
467467

468468
}
469469

470-
textures.safeSetTexture2D( v || emptyTexture, unit );
470+
textures.setTexture2D( v || emptyTexture, unit );
471471

472472
}
473473

@@ -499,7 +499,7 @@ function setValueT6( gl, v, textures ) {
499499

500500
}
501501

502-
textures.safeSetTextureCube( v || emptyCubeTexture, unit );
502+
textures.setTextureCube( v || emptyCubeTexture, unit );
503503

504504
}
505505

@@ -702,7 +702,7 @@ function setValueT1Array( gl, v, textures ) {
702702

703703
for ( let i = 0; i !== n; ++ i ) {
704704

705-
textures.safeSetTexture2D( v[ i ] || emptyTexture, units[ i ] );
705+
textures.setTexture2D( v[ i ] || emptyTexture, units[ i ] );
706706

707707
}
708708

@@ -734,7 +734,7 @@ function setValueT6Array( gl, v, textures ) {
734734

735735
for ( let i = 0; i !== n; ++ i ) {
736736

737-
textures.safeSetTextureCube( v[ i ] || emptyCubeTexture, units[ i ] );
737+
textures.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] );
738738

739739
}
740740

0 commit comments

Comments
 (0)