|
@@ -694,11 +694,19 @@ function setValueV4uiArray( gl, v ) {
|
|
|
|
|
|
function setValueT1Array( gl, v, textures ) {
|
|
|
|
|
|
+ const cache = this.cache;
|
|
|
+
|
|
|
const n = v.length;
|
|
|
|
|
|
const units = allocTexUnits( textures, n );
|
|
|
|
|
|
- gl.uniform1iv( this.addr, units );
|
|
|
+ if ( ! arraysEqual( cache, units ) ) {
|
|
|
+
|
|
|
+ gl.uniform1iv( this.addr, units );
|
|
|
+
|
|
|
+ copyArray( cache, units );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
for ( let i = 0; i !== n; ++ i ) {
|
|
|
|
|
@@ -710,11 +718,19 @@ function setValueT1Array( gl, v, textures ) {
|
|
|
|
|
|
function setValueT3DArray( gl, v, textures ) {
|
|
|
|
|
|
+ const cache = this.cache;
|
|
|
+
|
|
|
const n = v.length;
|
|
|
|
|
|
const units = allocTexUnits( textures, n );
|
|
|
|
|
|
- gl.uniform1iv( this.addr, units );
|
|
|
+ if ( ! arraysEqual( cache, units ) ) {
|
|
|
+
|
|
|
+ gl.uniform1iv( this.addr, units );
|
|
|
+
|
|
|
+ copyArray( cache, units );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
for ( let i = 0; i !== n; ++ i ) {
|
|
|
|
|
@@ -726,11 +742,19 @@ function setValueT3DArray( gl, v, textures ) {
|
|
|
|
|
|
function setValueT6Array( gl, v, textures ) {
|
|
|
|
|
|
+ const cache = this.cache;
|
|
|
+
|
|
|
const n = v.length;
|
|
|
|
|
|
const units = allocTexUnits( textures, n );
|
|
|
|
|
|
- gl.uniform1iv( this.addr, units );
|
|
|
+ if ( ! arraysEqual( cache, units ) ) {
|
|
|
+
|
|
|
+ gl.uniform1iv( this.addr, units );
|
|
|
+
|
|
|
+ copyArray( cache, units );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
for ( let i = 0; i !== n; ++ i ) {
|
|
|
|
|
@@ -742,11 +766,19 @@ function setValueT6Array( gl, v, textures ) {
|
|
|
|
|
|
function setValueT2DArrayArray( gl, v, textures ) {
|
|
|
|
|
|
+ const cache = this.cache;
|
|
|
+
|
|
|
const n = v.length;
|
|
|
|
|
|
const units = allocTexUnits( textures, n );
|
|
|
|
|
|
- gl.uniform1iv( this.addr, units );
|
|
|
+ if ( ! arraysEqual( cache, units ) ) {
|
|
|
+
|
|
|
+ gl.uniform1iv( this.addr, units );
|
|
|
+
|
|
|
+ copyArray( cache, units );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
for ( let i = 0; i !== n; ++ i ) {
|
|
|
|