@luma.gl/webgl 9.0.0-alpha.31 → 9.0.0-alpha.32

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/dist/index.cjs CHANGED
@@ -5121,34 +5121,34 @@ function parseUniformName(name2) {
5121
5121
  var import_constants23 = require("@luma.gl/constants");
5122
5122
  function setUniform(gl2, location, type, value) {
5123
5123
  const gl22 = gl2;
5124
- if (typeof value === "number") {
5125
- switch (type) {
5126
- case import_constants23.GL.SAMPLER_2D:
5127
- case import_constants23.GL.SAMPLER_CUBE:
5128
- case import_constants23.GL.SAMPLER_3D:
5129
- case import_constants23.GL.SAMPLER_2D_SHADOW:
5130
- case import_constants23.GL.SAMPLER_2D_ARRAY:
5131
- case import_constants23.GL.SAMPLER_2D_ARRAY_SHADOW:
5132
- case import_constants23.GL.SAMPLER_CUBE_SHADOW:
5133
- case import_constants23.GL.INT_SAMPLER_2D:
5134
- case import_constants23.GL.INT_SAMPLER_3D:
5135
- case import_constants23.GL.INT_SAMPLER_CUBE:
5136
- case import_constants23.GL.INT_SAMPLER_2D_ARRAY:
5137
- case import_constants23.GL.UNSIGNED_INT_SAMPLER_2D:
5138
- case import_constants23.GL.UNSIGNED_INT_SAMPLER_3D:
5139
- case import_constants23.GL.UNSIGNED_INT_SAMPLER_CUBE:
5140
- case import_constants23.GL.UNSIGNED_INT_SAMPLER_2D_ARRAY:
5141
- return gl2.uniform1i(location, value);
5142
- }
5143
- }
5144
- if (value === true) {
5145
- value = 1;
5146
- }
5147
- if (value === false) {
5148
- value = 0;
5149
- }
5150
- const arrayValue = typeof value === "number" ? [value] : value;
5124
+ let uniformValue = value;
5125
+ if (uniformValue === true) {
5126
+ uniformValue = 1;
5127
+ }
5128
+ if (uniformValue === false) {
5129
+ uniformValue = 0;
5130
+ }
5131
+ const arrayValue = typeof uniformValue === "number" ? [uniformValue] : uniformValue;
5151
5132
  switch (type) {
5133
+ case import_constants23.GL.SAMPLER_2D:
5134
+ case import_constants23.GL.SAMPLER_CUBE:
5135
+ case import_constants23.GL.SAMPLER_3D:
5136
+ case import_constants23.GL.SAMPLER_2D_SHADOW:
5137
+ case import_constants23.GL.SAMPLER_2D_ARRAY:
5138
+ case import_constants23.GL.SAMPLER_2D_ARRAY_SHADOW:
5139
+ case import_constants23.GL.SAMPLER_CUBE_SHADOW:
5140
+ case import_constants23.GL.INT_SAMPLER_2D:
5141
+ case import_constants23.GL.INT_SAMPLER_3D:
5142
+ case import_constants23.GL.INT_SAMPLER_CUBE:
5143
+ case import_constants23.GL.INT_SAMPLER_2D_ARRAY:
5144
+ case import_constants23.GL.UNSIGNED_INT_SAMPLER_2D:
5145
+ case import_constants23.GL.UNSIGNED_INT_SAMPLER_3D:
5146
+ case import_constants23.GL.UNSIGNED_INT_SAMPLER_CUBE:
5147
+ case import_constants23.GL.UNSIGNED_INT_SAMPLER_2D_ARRAY:
5148
+ if (typeof value !== "number") {
5149
+ throw new Error("samplers must be set to integers");
5150
+ }
5151
+ return gl2.uniform1i(location, value);
5152
5152
  case import_constants23.GL.FLOAT:
5153
5153
  return gl2.uniform1fv(location, arrayValue);
5154
5154
  case import_constants23.GL.FLOAT_VEC2:
@@ -5471,7 +5471,9 @@ var WEBGLRenderPipeline = class extends import_core23.RenderPipeline {
5471
5471
  set = true;
5472
5472
  }
5473
5473
  if (!set) {
5474
- import_core23.log.warn(`setAttributes(): Ignoring (buffer "${buffer.id}" for unknown attribute "${name}" in pipeline "${this.id}"`)();
5474
+ import_core23.log.warn(
5475
+ `setAttributes(): Ignoring (buffer "${buffer.id}" for unknown attribute "${name}" in pipeline "${this.id}"`
5476
+ )();
5475
5477
  }
5476
5478
  }
5477
5479
  }