Sfoglia il codice sorgente

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

Renaud Rohlinger 6 mesi fa
parent
commit
319461b0da
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 9 1
      src/renderers/webgpu/WebGPUBackend.js

+ 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号