Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: remove duplicate const #29237

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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