mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
26 lines
498 B
JavaScript
26 lines
498 B
JavaScript
class InputAssembler {
|
|
constructor(vb, ib, pt = gfx.PT_TRIANGLES) {
|
|
this._vertexBuffer = vb;
|
|
this._indexBuffer = ib;
|
|
this._primitiveType = pt;
|
|
this._start = 0;
|
|
this._count = -1;
|
|
|
|
// TODO: instancing data
|
|
// this._stream = 0;
|
|
}
|
|
|
|
getPrimitiveCount () {
|
|
if (this._count !== -1) {
|
|
return this._count;
|
|
}
|
|
|
|
if (this._indexBuffer) {
|
|
return this._indexBuffer.count;
|
|
}
|
|
|
|
return this._vertexBuffer.count;
|
|
}
|
|
}
|
|
|
|
module.exports = InputAssembler; |