Skip to content

Commit 319461b

Browse files
WebGPUBackend: Allow Storage Buffer on Index Attribute (mrdoob#31335)
1 parent 15ff86b commit 319461b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/renderers/webgpu/WebGPUBackend.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,15 @@ class WebGPUBackend extends Backend {
20922092
*/
20932093
createIndexAttribute( attribute ) {
20942094

2095-
this.attributeUtils.createAttribute( attribute, GPUBufferUsage.INDEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST );
2095+
let usage = GPUBufferUsage.INDEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST;
2096+
2097+
if ( attribute.isStorageBufferAttribute || attribute.isStorageInstancedBufferAttribute ) {
2098+
2099+
usage |= GPUBufferUsage.STORAGE;
2100+
2101+
}
2102+
2103+
this.attributeUtils.createAttribute( attribute, usage );
20962104

20972105
}
20982106

0 commit comments

Comments
 (0)