@luma.gl/webgl 9.0.5 → 9.0.6

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
@@ -3065,10 +3065,10 @@ ${source2}`;
3065
3065
  }
3066
3066
  if (!this.device.features.has("compilation-status-async-webgl")) {
3067
3067
  this._getCompilationStatus();
3068
+ this.debugShader();
3068
3069
  if (this.compilationStatus === "error") {
3069
3070
  throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);
3070
3071
  }
3071
- this.debugShader();
3072
3072
  return;
3073
3073
  }
3074
3074
  import_core14.log.once(1, "Shader compilation is asynchronous")();
@@ -3111,6 +3111,7 @@ var GL_DEPTH_BUFFER_BIT = 256;
3111
3111
  var GL_STENCIL_BUFFER_BIT = 1024;
3112
3112
  var GL_COLOR_BUFFER_BIT = 16384;
3113
3113
  var GL_COLOR = 6144;
3114
+ var COLOR_CHANNELS = [1, 2, 4, 8];
3114
3115
  var WEBGLRenderPass = class extends import_core15.RenderPass {
3115
3116
  device;
3116
3117
  /** Parameters that should be applied before each draw call */
@@ -3169,6 +3170,9 @@ var WEBGLRenderPass = class extends import_core15.RenderPass {
3169
3170
  console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL");
3170
3171
  parameters[2967] = parameters.stencilReference;
3171
3172
  }
3173
+ if (parameters.colorMask) {
3174
+ glParameters.colorMask = COLOR_CHANNELS.map((channel) => Boolean(channel & parameters.colorMask));
3175
+ }
3172
3176
  this.glParameters = glParameters;
3173
3177
  setGLParameters(this.device.gl, glParameters);
3174
3178
  }
@@ -3935,6 +3939,8 @@ var WEBGLRenderPipeline = class extends import_core17.RenderPipeline {
3935
3939
  var _a;
3936
3940
  const {
3937
3941
  renderPass,
3942
+ parameters = this.props.parameters,
3943
+ topology = this.props.topology,
3938
3944
  vertexArray,
3939
3945
  vertexCount,
3940
3946
  // indexCount,
@@ -3945,7 +3951,7 @@ var WEBGLRenderPipeline = class extends import_core17.RenderPipeline {
3945
3951
  // baseVertex,
3946
3952
  transformFeedback
3947
3953
  } = options;
3948
- const glDrawMode = getGLDrawMode(this.props.topology);
3954
+ const glDrawMode = getGLDrawMode(topology);
3949
3955
  const isIndexed = Boolean(vertexArray.indexBuffer);
3950
3956
  const glIndexType = (_a = vertexArray.indexBuffer) == null ? void 0 : _a.glIndexType;
3951
3957
  const isInstanced = Number(instanceCount) > 0;
@@ -3969,7 +3975,7 @@ var WEBGLRenderPipeline = class extends import_core17.RenderPipeline {
3969
3975
  this._applyBindings();
3970
3976
  this._applyUniforms();
3971
3977
  const webglRenderPass = renderPass;
3972
- withDeviceAndGLParameters(this.device, this.props.parameters, webglRenderPass.glParameters, () => {
3978
+ withDeviceAndGLParameters(this.device, parameters, webglRenderPass.glParameters, () => {
3973
3979
  if (isIndexed && isInstanced) {
3974
3980
  this.device.gl.drawElementsInstanced(
3975
3981
  glDrawMode,