Skip to content

Commit

Permalink
Support colorMask in RenderPass
Browse files Browse the repository at this point in the history
  • Loading branch information
felixpalmer committed Mar 20, 2024
1 parent 12675c6 commit f59d1d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/core/src/adapter/types/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ export type RenderPassParameters = {
blendConstant?: number[]; // GPUColor
/** Stencil operation "replace" sets the value to stencilReference */
stencilReference?: number; // GPUStencilValue

/** Sets mask for channels (RGBA) to render/clear **/
colorMask?: boolean[];
};

export type RenderPipelineParameters = RasterizationParameters &
Expand Down
3 changes: 3 additions & 0 deletions modules/webgl/src/adapter/resources/webgl-render-pass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export class WEBGLRenderPass extends RenderPass {
// Does this work?
parameters[GL.STENCIL_REF] = parameters.stencilReference;
}
if (parameters.colorMask) {
glParameters.colorMask = parameters.colorMask;
}

this.glParameters = glParameters;

Expand Down

0 comments on commit f59d1d4

Please sign in to comment.