Skip to content

Commit 9e36393

Browse files
committed
fix webglBackend error
1 parent def6f16 commit 9e36393

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

src/renderers/common/Bindings.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,17 @@ class Bindings extends DataMap {
162162

163163
const bindings = this.nodes.getForCompute( computeNode ).bindings;
164164

165-
for ( const bindGroup of bindings ) {
165+
if ( this.backend.isWebGPUBackend ) {
166+
167+
for ( const bindGroup of bindings ) {
168+
169+
this.backend.deleteBindGroupData( bindGroup );
170+
171+
}
172+
173+
}
166174

167-
this.backend.deleteBindingsData( bindGroup );
175+
for ( const bindGroup of bindings ) {
168176

169177
this.delete( bindGroup );
170178

@@ -181,9 +189,17 @@ class Bindings extends DataMap {
181189

182190
const bindings = renderObject.getBindings();
183191

184-
for ( const bindGroup of bindings ) {
192+
if ( this.backend.isWebGPUBackend ) {
193+
194+
for ( const bindGroup of bindings ) {
195+
196+
this.backend.deleteBindGroupData( bindGroup );
197+
198+
}
199+
200+
}
185201

186-
this.backend.deleteBindingsData( bindGroup );
202+
for ( const bindGroup of bindings ) {
187203

188204
this.delete( bindGroup );
189205

src/renderers/webgpu/WebGPUBackend.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2126,7 +2126,7 @@ class WebGPUBackend extends Backend {
21262126
*/
21272127
deleteBindingsData( bindGroup ) {
21282128

2129-
this.bindingsUtils.deleteBindingsData( bindGroup );
2129+
this.bindingsUtils.deleteBindGroupData( bindGroup );
21302130

21312131
}
21322132

src/renderers/webgpu/utils/WebGPUBindingUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ class WebGPUBindingUtils {
495495
*
496496
* @param {BindGroup} bindGroup - The bind group.
497497
*/
498-
deleteBindingsData( bindGroup ) {
498+
deleteBindGroupData( bindGroup ) {
499499

500500
const { backend } = this;
501501

0 commit comments

Comments
 (0)