@needle-tools/three 0.185.1 → 0.185.2-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/three",
3
- "version": "0.185.1",
3
+ "version": "0.185.2-alpha",
4
4
  "description": "JavaScript 3D library",
5
5
  "type": "module",
6
6
  "main": "./build/three.cjs",
package/src/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export const REVISION = '185.1';
1
+ export const REVISION = '185.2-alpha';
2
2
 
3
3
  /**
4
4
  * Represents mouse buttons and interaction types in context of controls.
@@ -806,12 +806,31 @@ function setValueV4uiArray( gl, v ) {
806
806
 
807
807
  // Array of textures (2D / 3D / Cube / 2DArray)
808
808
 
809
+ const _warnedEmptySamplerArray = new Set();
810
+
809
811
  function setValueT1Array( gl, v, textures ) {
810
812
 
811
813
  const cache = this.cache;
812
814
 
813
815
  const n = v.length;
814
816
 
817
+ // An empty sampler array (`sampler2D x[0]`) has nothing to bind, and Chrome throws
818
+ // "WebGL: INVALID_VALUE: uniform1iv: no array" on `gl.uniform1iv([])` — every frame.
819
+ // Skip the upload (a genuine no-op) and warn once per uniform so the source of the
820
+ // empty array can be tracked down. Seen with empty shadow sampler arrays (ContactShadows).
821
+ if ( n === 0 ) {
822
+
823
+ if ( ! _warnedEmptySamplerArray.has( this.id ) ) {
824
+
825
+ _warnedEmptySamplerArray.add( this.id );
826
+ console.warn( `THREE.WebGLUniforms: skipping empty sampler array uniform '${ this.id }' (nothing to bind).` );
827
+
828
+ }
829
+
830
+ return;
831
+
832
+ }
833
+
815
834
  const units = allocTexUnits( textures, n );
816
835
 
817
836
  if ( ! arraysEqual( cache, units ) ) {