Browse Source

WebGPUBackend: Simplify code. (#33388)

Michael Herzog 2 months ago
parent
commit
d291f9bb3f
1 changed files with 3 additions and 6 deletions
  1. 3 6
      src/renderers/webgpu/WebGPUBackend.js

+ 3 - 6
src/renderers/webgpu/WebGPUBackend.js

@@ -1613,20 +1613,17 @@ class WebGPUBackend extends Backend {
 
 			for ( let i = 0; i < drawCount; i ++ ) {
 
-				const count = 1;
-				const firstInstance = count > 1 ? 0 : i;
-
 				if ( hasIndex === true ) {
 
-					passEncoderGPU.drawIndexed( counts[ i ], count, starts[ i ] / bytesPerElement, 0, firstInstance );
+					passEncoderGPU.drawIndexed( counts[ i ], 1, starts[ i ] / bytesPerElement, 0, i );
 
 				} else {
 
-					passEncoderGPU.draw( counts[ i ], count, starts[ i ], firstInstance );
+					passEncoderGPU.draw( counts[ i ], 1, starts[ i ], i );
 
 				}
 
-				info.update( object, counts[ i ], count );
+				info.update( object, counts[ i ], 1 );
 
 			}
 

粤ICP备19079148号