Browse Source

WebGPUBackend: BatchedMesh in WebGPU throw Error: reading "bytesPerElement" of null (#29140)

Co-authored-by: wangziqian <wangziqian@fabu.ai>
Lee 1 year ago
parent
commit
e652a07d79
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/renderers/webgpu/WebGPUBackend.js

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

@@ -955,7 +955,7 @@ class WebGPUBackend extends Backend {
 			const drawCount = object._multiDrawCount;
 			const drawInstances = object._multiDrawInstances;
 
-			const bytesPerElement = index.bytesPerElement || 1;
+			const bytesPerElement = hasIndex ? index.bytesPerElement : 1;
 
 			for ( let i = 0; i < drawCount; i ++ ) {
 

粤ICP备19079148号