@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/build/three.cjs +20 -1
- package/build/three.core.js +1 -1
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +19 -0
- package/build/three.module.min.js +1 -1
- package/package.json +1 -1
- package/src/constants.js +1 -1
- package/src/renderers/webgl/WebGLUniforms.js +19 -0
package/package.json
CHANGED
package/src/constants.js
CHANGED
|
@@ -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 ) ) {
|