@@ -319,7 +319,7 @@ function rendererWebGPU(p5, fn) {
319319 }
320320 if ( this . _pInst . _webgpuAttributes [ key ] !== value ) {
321321 //changing value of previously altered attribute
322- this . _webgpuAttributes [ key ] = value ;
322+ this . _pInst . _webgpuAttributes [ key ] = value ;
323323 unchanged = false ;
324324 }
325325 //setting all attributes with some change
@@ -682,9 +682,9 @@ function rendererWebGPU(p5, fn) {
682682 1 ; // No MSAA needed when blitting already-antialiased textures to canvas
683683 const sampleCount = this . _getValidSampleCount ( requestedSampleCount ) ;
684684
685- const depthFormat = activeFramebuffer && activeFramebuffer . useDepth ?
686- this . _getWebGPUDepthFormat ( activeFramebuffer ) :
687- this . depthFormat ;
685+ const depthFormat = activeFramebuffer
686+ ? ( activeFramebuffer . useDepth ? this . _getWebGPUDepthFormat ( activeFramebuffer ) : undefined )
687+ : this . depthFormat ;
688688
689689 const drawTarget = this . drawTarget ( ) ;
690690 const clipping = this . _clipping ;
@@ -761,25 +761,27 @@ function rendererWebGPU(p5, fn) {
761761 } ,
762762 primitive : { topology } ,
763763 multisample : { count : sampleCount } ,
764- depthStencil : {
765- format : depthFormat ,
766- depthWriteEnabled : ! clipping ,
767- depthCompare : 'less-equal' ,
768- stencilFront : {
769- compare : clipping ? 'always' : ( clipApplied ? 'not-equal' : 'always' ) ,
770- failOp : 'keep' ,
771- depthFailOp : 'keep' ,
772- passOp : clipping ? 'replace' : 'keep' ,
764+ ...( depthFormat ? {
765+ depthStencil : {
766+ format : depthFormat ,
767+ depthWriteEnabled : ! clipping ,
768+ depthCompare : 'less-equal' ,
769+ stencilFront : {
770+ compare : clipping ? 'always' : ( clipApplied ? 'not-equal' : 'always' ) ,
771+ failOp : 'keep' ,
772+ depthFailOp : 'keep' ,
773+ passOp : clipping ? 'replace' : 'keep' ,
774+ } ,
775+ stencilBack : {
776+ compare : clipping ? 'always' : ( clipApplied ? 'not-equal' : 'always' ) ,
777+ failOp : 'keep' ,
778+ depthFailOp : 'keep' ,
779+ passOp : clipping ? 'replace' : 'keep' ,
780+ } ,
781+ stencilReadMask : 0xFF ,
782+ stencilWriteMask : clipping ? 0xFF : 0x00 ,
773783 } ,
774- stencilBack : {
775- compare : clipping ? 'always' : ( clipApplied ? 'not-equal' : 'always' ) ,
776- failOp : 'keep' ,
777- depthFailOp : 'keep' ,
778- passOp : clipping ? 'replace' : 'keep' ,
779- } ,
780- stencilReadMask : 0xFF ,
781- stencilWriteMask : clipping ? 0xFF : 0x00 ,
782- } ,
784+ } : { } ) ,
783785 } ) ;
784786 shader . _pipelineCache . set ( key , pipeline ) ;
785787 }
@@ -2986,7 +2988,7 @@ ${hookUniformFields}}
29862988 }
29872989
29882990 defaultFramebufferAntialias ( ) {
2989- return true ;
2991+ return this . _pInst . _webgpuAttributes ?. antialias !== false ;
29902992 }
29912993
29922994 supportsFramebufferAntialias ( ) {
@@ -3852,13 +3854,6 @@ ${hookUniformFields}}
38523854 px = Math . ceil ( Math . sqrt ( totalIterations ) ) ;
38533855 py = Math . ceil ( totalIterations / px ) ;
38543856 pz = 1 ;
3855-
3856- if ( p5 . debug || exceedsLimits ) {
3857- console . warn (
3858- `p5.js: Compute dispatch (${ x } , ${ y } , ${ z } ) auto-spread to (${ px } , ${ py } , 1) ` +
3859- `to ${ exceedsLimits ? 'stay within GPU limits' : 'optimize performance' } .`
3860- ) ;
3861- }
38623857 }
38633858
38643859 shader . setUniform ( 'uPhysicalCount' , [ px , py , pz ] ) ;
0 commit comments