Jelajahi Sumber

Merge pull request #18436 from Mugen87/dev29

WebGLUniforms: Support uint uniform type.
Mr.doob 5 tahun lalu
induk
melakukan
5f815a3be0
1 mengubah file dengan 16 tambahan dan 0 penghapusan
  1. 16 0
      src/renderers/webgl/WebGLUniforms.js

+ 16 - 0
src/renderers/webgl/WebGLUniforms.js

@@ -465,6 +465,20 @@ function setValueV4i( gl, v ) {
 
 }
 
+// uint
+
+function setValueV1ui( gl, v ) {
+
+	var cache = this.cache;
+
+	if ( cache[ 0 ] === v ) return;
+
+	gl.uniform1ui( this.addr, v );
+
+	cache[ 0 ] = v;
+
+}
+
 // Helper to pick the right setter for the singular case
 
 function getSingularSetter( type ) {
@@ -485,6 +499,8 @@ function getSingularSetter( type ) {
 		case 0x8b54: case 0x8b58: return setValueV3i; // _VEC3
 		case 0x8b55: case 0x8b59: return setValueV4i; // _VEC4
 
+		case 0x1405: return setValueV1ui; // UINT
+
 		case 0x8b5e: // SAMPLER_2D
 		case 0x8d66: // SAMPLER_EXTERNAL_OES
 		case 0x8dca: // INT_SAMPLER_2D