Jelajahi Sumber

WebGPURenderer: Fix BatchedMesh with indexed geometry (#29174)

Renaud Rohlinger 1 tahun lalu
induk
melakukan
01a9311076
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      src/renderers/webgpu/WebGPUBackend.js

+ 2 - 2
src/renderers/webgpu/WebGPUBackend.js

@@ -955,14 +955,14 @@ class WebGPUBackend extends Backend {
 			const drawCount = object._multiDrawCount;
 			const drawInstances = object._multiDrawInstances;
 
-			const bytesPerElement = hasIndex ? index.bytesPerElement : 1;
+			const bytesPerElement = hasIndex ? index.array.BYTES_PER_ELEMENT : 1;
 
 			for ( let i = 0; i < drawCount; i ++ ) {
 
 				const count = drawInstances ? drawInstances[ i ] : 1;
 				const firstInstance = count > 1 ? 0 : i;
 
-				passEncoderGPU.drawIndexed( counts[ i ] / bytesPerElement, count, starts[ i ] / 4, 0, firstInstance );
+				passEncoderGPU.drawIndexed( counts[ i ], count, starts[ i ] / bytesPerElement, 0, firstInstance );
 
 			}
 

粤ICP备19079148号