({ mode, compute, workgroupSize })
| 854 | } |
| 855 | |
| 856 | _shaderOptions({ mode, compute, workgroupSize }) { |
| 857 | if (compute) return { compute: true, workgroupSize }; |
| 858 | const activeFramebuffer = this.activeFramebuffer(); |
| 859 | const format = activeFramebuffer ? |
| 860 | this._getWebGPUColorFormat(activeFramebuffer) : |
| 861 | this.presentationFormat; |
| 862 | |
| 863 | const requestedSampleCount = activeFramebuffer ? |
| 864 | (activeFramebuffer.antialias ? activeFramebuffer.antialiasSamples : 1) : |
| 865 | 1; // No MSAA needed when blitting already-antialiased textures to canvas |
| 866 | const sampleCount = this._getValidSampleCount(requestedSampleCount); |
| 867 | |
| 868 | const depthFormat = activeFramebuffer |
| 869 | ? (activeFramebuffer.useDepth ? this._getWebGPUDepthFormat(activeFramebuffer) : undefined) |
| 870 | : this.depthFormat; |
| 871 | |
| 872 | const drawTarget = this.drawTarget(); |
| 873 | const clipping = this._clipping; |
| 874 | const clipApplied = drawTarget._isClipApplied; |
| 875 | |
| 876 | return { |
| 877 | topology: mode === constants.TRIANGLE_STRIP ? 'triangle-strip' : 'triangle-list', |
| 878 | blendMode: this.states.curBlendMode, |
| 879 | sampleCount, |
| 880 | format, |
| 881 | depthFormat, |
| 882 | clipping, |
| 883 | clipApplied, |
| 884 | } |
| 885 | } |
| 886 | |
| 887 | _shaderOptionsDifferent(newOptions) { |
| 888 | if (!this.activeShaderOptions) return true; |
no test coverage detected