1
0
Эх сурвалжийг харах

WebGPUBackend: Allow Storage Buffer on Index Attribute (#31335)

Renaud Rohlinger 6 сар өмнө
parent
commit
319461b0da

+ 9 - 1
src/renderers/webgpu/WebGPUBackend.js

@@ -2092,7 +2092,15 @@ class WebGPUBackend extends Backend {
 	 */
 	createIndexAttribute( attribute ) {
 
-		this.attributeUtils.createAttribute( attribute, GPUBufferUsage.INDEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST );
+		let usage = GPUBufferUsage.INDEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST;
+
+		if ( attribute.isStorageBufferAttribute || attribute.isStorageInstancedBufferAttribute ) {
+
+			usage |= GPUBufferUsage.STORAGE;
+
+		}
+
+		this.attributeUtils.createAttribute( attribute, usage );
 
 	}
 

粤ICP备19079148号