()
| 2662 | } |
| 2663 | |
| 2664 | _clearClipBuffer() { |
| 2665 | this._finishActiveRenderPass(); |
| 2666 | const commandEncoder = this.device.createCommandEncoder(); |
| 2667 | |
| 2668 | const activeFramebuffer = this.activeFramebuffer(); |
| 2669 | const depthTextureView = activeFramebuffer |
| 2670 | ? (activeFramebuffer.aaDepthTexture |
| 2671 | ? activeFramebuffer.aaDepthTextureView |
| 2672 | : activeFramebuffer.depthTextureView) |
| 2673 | : this.depthTextureView; |
| 2674 | |
| 2675 | if (!depthTextureView) { |
| 2676 | return; |
| 2677 | } |
| 2678 | |
| 2679 | const depthStencilAttachment = { |
| 2680 | view: depthTextureView, |
| 2681 | stencilLoadOp: 'clear', |
| 2682 | stencilStoreOp: 'store', |
| 2683 | stencilClearValue: 1, |
| 2684 | depthReadOnly: true, |
| 2685 | stencilReadOnly: false, |
| 2686 | }; |
| 2687 | |
| 2688 | const renderPassDescriptor = { |
| 2689 | colorAttachments: [], |
| 2690 | depthStencilAttachment: depthStencilAttachment, |
| 2691 | }; |
| 2692 | |
| 2693 | const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); |
| 2694 | passEncoder.end(); |
| 2695 | |
| 2696 | this._pendingCommandEncoders.push(commandEncoder.finish()); |
| 2697 | this._hasPendingDraws = true; |
| 2698 | } |
| 2699 | |
| 2700 | _applyStencilTestIfClipping() { |
| 2701 | // This is done via pipeline state in WebGL so this is a no-op |
nothing calls this directly
no test coverage detected