Просмотр исходного кода

WebGPURenderer: Fix BatchedMesh with indexed geometry (#29174)

Renaud Rohlinger 1 год назад
Родитель
Сommit
01a9311076
1 измененных файлов с 2 добавлено и 2 удалено
  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 drawCount = object._multiDrawCount;
 			const drawInstances = object._multiDrawInstances;
 			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 ++ ) {
 			for ( let i = 0; i < drawCount; i ++ ) {
 
 
 				const count = drawInstances ? drawInstances[ i ] : 1;
 				const count = drawInstances ? drawInstances[ i ] : 1;
 				const firstInstance = count > 1 ? 0 : i;
 				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号