|
@@ -923,12 +923,16 @@ class WebGPUBackend extends Backend {
|
|
const starts = object._multiDrawStarts;
|
|
const starts = object._multiDrawStarts;
|
|
const counts = object._multiDrawCounts;
|
|
const counts = object._multiDrawCounts;
|
|
const drawCount = object._multiDrawCount;
|
|
const drawCount = object._multiDrawCount;
|
|
|
|
+ const drawInstances = object._multiDrawInstances;
|
|
|
|
|
|
const bytesPerElement = index.bytesPerElement || 1;
|
|
const bytesPerElement = index.bytesPerElement || 1;
|
|
|
|
|
|
for ( let i = 0; i < drawCount; i ++ ) {
|
|
for ( let i = 0; i < drawCount; i ++ ) {
|
|
|
|
|
|
- passEncoderGPU.drawIndexed( counts[ i ] / bytesPerElement, 1, starts[ i ] / 4, 0, i );
|
|
|
|
|
|
+ const count = drawInstances ? drawInstances[ i ] : 1;
|
|
|
|
+ const firstInstance = count > 1 ? 0 : i;
|
|
|
|
+
|
|
|
|
+ passEncoderGPU.drawIndexed( counts[ i ] / bytesPerElement, count, starts[ i ] / 4, 0, firstInstance );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|