Prechádzať zdrojové kódy

HTMLTexture: Annotate Chrome versions for each API code path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mr.doob 1 deň pred
rodič
commit
ff95cea91e

+ 4 - 0
src/renderers/webgl-fallback/utils/WebGLTextureUtils.js

@@ -640,10 +640,14 @@ class WebGLTextureUtils {
 
 				if ( gl.texElementImage2D.length === 3 ) {
 
+					// Chrome 150+
+
 					gl.texElementImage2D( gl.TEXTURE_2D, gl.RGBA8, options.image );
 
 				} else {
 
+					// Chrome 138 - 149
+
 					gl.texElementImage2D( gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, options.image );
 
 				}

+ 4 - 0
src/renderers/webgl/WebGLTextures.js

@@ -1297,10 +1297,14 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 					if ( _gl.texElementImage2D.length === 3 ) {
 
+						// Chrome 150+
+
 						_gl.texElementImage2D( _gl.TEXTURE_2D, _gl.RGBA8, image );
 
 					} else {
 
+						// Chrome 138 - 149
+
 						const level = 0;
 						const internalFormat = _gl.RGBA;
 						const srcFormat = _gl.RGBA;

+ 4 - 0
src/renderers/webgpu/utils/WebGPUTextureUtils.js

@@ -650,6 +650,8 @@ class WebGPUTextureUtils {
 
 			if ( device.queue.copyElementImageToTexture.length === 2 ) {
 
+				// Chrome 150+
+
 				device.queue.copyElementImageToTexture(
 					{ source: image },
 					{
@@ -661,6 +663,8 @@ class WebGPUTextureUtils {
 
 			} else {
 
+				// Chrome 138 - 149
+
 				device.queue.copyElementImageToTexture(
 					image, width, height,
 					{ texture: textureData.texture }

粤ICP备19079148号