Skip to content

Commit 0c7cf78

Browse files
WebGPURenderer: Add support for geometry without attributes (#29576)
1 parent 702b698 commit 0c7cf78

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/renderers/common/RenderObject.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,18 @@ export default class RenderObject {
233233

234234
}
235235

236-
const itemCount = hasIndex === true ? index.count : geometry.attributes.position.count;
236+
const position = geometry.attributes.position;
237+
let itemCount = Infinity;
238+
239+
if ( hasIndex ) {
240+
241+
itemCount = index.count;
242+
243+
} else if ( position !== undefined && position !== null ) {
244+
245+
itemCount = position.count;
246+
247+
}
237248

238249
firstVertex = Math.max( firstVertex, 0 );
239250
lastVertex = Math.min( lastVertex, itemCount );

0 commit comments

Comments
 (0)