MCPcopy Index your code
hub / github.com/processing/p5.js / _applyClip

Method _applyClip

src/webgpu/p5.RendererWebGPU.js:2623–2656  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2621 }
2622
2623 _applyClip() {
2624 const commandEncoder = this.device.createCommandEncoder();
2625
2626 const activeFramebuffer = this.activeFramebuffer();
2627 const depthTextureView = activeFramebuffer
2628 ? (activeFramebuffer.aaDepthTexture
2629 ? activeFramebuffer.aaDepthTextureView
2630 : activeFramebuffer.depthTextureView)
2631 : this.depthTextureView;
2632
2633 if (!depthTextureView) {
2634 return;
2635 }
2636
2637 const depthStencilAttachment = {
2638 view: depthTextureView,
2639 stencilLoadOp: 'clear',
2640 stencilStoreOp: 'store',
2641 stencilClearValue: 0,
2642 depthReadOnly: true,
2643 stencilReadOnly: false,
2644 };
2645
2646 const renderPassDescriptor = {
2647 colorAttachments: [],
2648 depthStencilAttachment: depthStencilAttachment,
2649 };
2650
2651 const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
2652 passEncoder.end();
2653
2654 this._pendingCommandEncoders.push(commandEncoder.finish());
2655 this._hasPendingDraws = true;
2656 }
2657
2658 _unapplyClip() {
2659 // In WebGPU, clip unapplication is handled through pipeline state rather than direct commands

Callers

nothing calls this directly

Calls 4

activeFramebufferMethod · 0.80
endMethod · 0.80
finishMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected