Skip to content

Commit 1b33b9e

Browse files
chelgeson1clickcmhhelgeson
authored andcommitted
rework
1 parent 36a1001 commit 1b33b9e

File tree

5 files changed

+203
-130
lines changed

5 files changed

+203
-130
lines changed

src/renderers/common/Backend.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,14 @@ class Backend {
725725

726726
}
727727

728+
/**
729+
* Delete GPU data associated with a bind group.
730+
*
731+
* @abstract
732+
* @param {BindGroup} bindGroup - The bind group.
733+
*/
734+
deleteBindGroupData( /*bindGroup*/ ) { }
735+
728736
/**
729737
* Deletes an object from the internal data structure.
730738
*

src/renderers/common/Bindings.js

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

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

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

167+
this.backend.deleteBindGroupData( bindGroup );
177168
this.delete( bindGroup );
178169

179170
}
@@ -189,18 +180,9 @@ class Bindings extends DataMap {
189180

190181
const bindings = renderObject.getBindings();
191182

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

185+
this.backend.deleteBindGroupData( bindGroup );
204186
this.delete( bindGroup );
205187

206188
}

src/renderers/webgpu/WebGPUBackend.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,11 @@ class WebGPUBackend extends Backend {
16521652

16531653
data[ 0 ] = i;
16541654

1655-
const bindGroupIndex = this.bindingUtils.createBindGroupIndex( data, bindingsData.layout );
1655+
const { layoutGPU } = bindingsData.layout;
1656+
1657+
console.log( layoutGPU );
1658+
1659+
const bindGroupIndex = this.bindingUtils.createBindGroupIndex( data, layoutGPU );
16561660

16571661
indexesGPU.push( bindGroupIndex );
16581662

0 commit comments

Comments
 (0)