Skip to content

Commit

Permalink
remove duplicate const
Browse files Browse the repository at this point in the history
  • Loading branch information
aardgoose committed Aug 27, 2024
1 parent 5c92699 commit d304f6f
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/renderers/webgpu/WebGPUBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,26 +828,23 @@ class WebGPUBackend extends Backend {
draw( renderObject, info ) {

const { object, geometry, context, pipeline } = renderObject;

const bindings = renderObject.getBindings();
const contextData = this.get( context );
const renderContextData = this.get( context );
const pipelineGPU = this.get( pipeline ).pipeline;
const currentSets = contextData.currentSets;
const currentSets = renderContextData.currentSets;

const renderObjectData = this.get( renderObject );

const { bundleEncoder, renderBundle, lastPipelineGPU } = renderObjectData;

const renderContextData = this.get( context );

if ( renderContextData.registerBundlesPhase === true && bundleEncoder !== undefined && lastPipelineGPU === pipelineGPU ) {

renderContextData.renderBundles.push( renderBundle );
return;

}

const passEncoderGPU = this.renderer._currentRenderBundle ? this.createBundleEncoder( context, renderObject ) : contextData.currentPass;
const passEncoderGPU = this.renderer._currentRenderBundle ? this.createBundleEncoder( context, renderObject ) : renderContextData.currentPass;

// pipeline

Expand Down Expand Up @@ -914,27 +911,27 @@ class WebGPUBackend extends Backend {

// occlusion queries - handle multiple consecutive draw calls for an object

if ( contextData.occlusionQuerySet !== undefined ) {
if ( renderContextData.occlusionQuerySet !== undefined ) {

const lastObject = contextData.lastOcclusionObject;
const lastObject = renderContextData.lastOcclusionObject;

if ( lastObject !== object ) {

if ( lastObject !== null && lastObject.occlusionTest === true ) {

passEncoderGPU.endOcclusionQuery();
contextData.occlusionQueryIndex ++;
renderContextData.occlusionQueryIndex ++;

}

if ( object.occlusionTest === true ) {

passEncoderGPU.beginOcclusionQuery( contextData.occlusionQueryIndex );
contextData.occlusionQueryObjects[ contextData.occlusionQueryIndex ] = object;
passEncoderGPU.beginOcclusionQuery( renderContextData.occlusionQueryIndex );
renderContextData.occlusionQueryObjects[ renderContextData.occlusionQueryIndex ] = object;

}

contextData.lastOcclusionObject = object;
renderContextData.lastOcclusionObject = object;

}

Expand Down

0 comments on commit d304f6f

Please sign in to comment.