Skip to content

Commit

Permalink
WebGPURenderer: add clearAsync() clear[color|depth|stencil]Async() (#…
Browse files Browse the repository at this point in the history
…27613)

Co-authored-by: aardgoose <angus.sawyer@email.com>
  • Loading branch information
aardgoose and aardgoose committed Jan 23, 2024
1 parent a63c3f4 commit e8884ad
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions examples/jsm/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,9 @@ class Renderer {

}

clear( color = true, depth = true, stencil = true ) {
async clearAsync( color = true, depth = true, stencil = true ) {

if ( this._initialized === false ) await this.init();

let renderTargetData = null;
const renderTarget = this._renderTarget;
Expand All @@ -625,21 +627,21 @@ class Renderer {

}

clearColor() {
clearColorAsync() {

this.clear( true, false, false );
return this.clearAsync( true, false, false );

}

clearDepth() {
clearDepthAsync() {

this.clear( false, true, false );
return this.clearAsync( false, true, false );

}

clearStencil() {
clearStencilAsync() {

this.clear( false, false, true );
return this.clearAsync( false, false, true );

}

Expand Down Expand Up @@ -1059,6 +1061,30 @@ class Renderer {

}

get clear() {

return this.clearAsync;

}

get clearColor() {

return this.clearColorAsync;

}

get clearDepth() {

return this.clearDepthAsync;

}

get clearStencil() {

return this.clearStencilAsync;

}

}

export default Renderer;

0 comments on commit e8884ad

Please sign in to comment.