Browse Source

Add support for RG_INTEGER format in WebGLTextures.getInternalFormat (#27688)

Co-authored-by: Jure <[email protected]>
Jure Ratkovic 1 year ago
parent
commit
85e5ddaa02
1 changed files with 11 additions and 0 deletions
  1. 11 0
      src/renderers/webgl/WebGLTextures.js

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

@@ -173,6 +173,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 		}
 
+		if ( glFormat === _gl.RG_INTEGER ) {
+
+			if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8UI;
+			if ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RG16UI;
+			if ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RG32UI;
+			if ( glType === _gl.BYTE ) internalFormat = _gl.RG8I;
+			if ( glType === _gl.SHORT ) internalFormat = _gl.RG16I;
+			if ( glType === _gl.INT ) internalFormat = _gl.RG32I;
+
+		}
+
 		if ( glFormat === _gl.RGBA ) {
 
 			const transfer = forceLinearTransfer ? LinearTransfer : ColorManagement.getTransfer( colorSpace );