Files
cocos4/cocos/core/gfx/webgl/webgl-queue.ts
T
Yun Hsiao Wu dfc3d141f2 GFX Descriptor Set (#7101)
* gfx: descriptor sets

* gfx: descriptor set, singular

* better structure

* adapt upper layers: first pass

finally all compiler errors cleared.

OKAY IT'S HAPPENING EVERYBODY STAY THE ****ING CALM

* adapt upper layers: second pass

THERE AND BACK AGAIN

* unified light pass & shadow shader

* gfx: descriptor set & pipeline layout

* light pass: better structure

* light pass: dynamic uniform

* even more type checking for memory pools

* Fix particleSystem and lineComponent.

* delete comment

* guard pool init param

* Fix trail module error.

* delete space

* light pass: instancing & batching support

* don't polyfill gfx stuff inside EffectAsset

* better light pass structure

* fix spot light culling

Co-authored-by: caryliu <caryliu1999@gmail.com>
2020-08-13 18:21:15 +08:00

40 lines
1.1 KiB
TypeScript

import { GFXCommandBuffer } from '../command-buffer';
import { GFXQueue, IGFXQueueInfo } from '../queue';
import { GFXFence } from '../fence';
export class WebGLQueue extends GFXQueue {
public numDrawCalls: number = 0;
public numInstances: number = 0;
public numTris: number = 0;
public initialize (info: IGFXQueueInfo): boolean {
this._type = info.type;
return true;
}
public destroy () {
}
public submit (cmdBuffs: GFXCommandBuffer[], fence?: GFXFence) {
if (!this._isAsync) {
const len = cmdBuffs.length;
for (let i = 0; i < len; i++) {
const cmdBuff = cmdBuffs[i];
// WebGLCmdFuncExecuteCmds( this._device as WebGLDevice, (cmdBuff as WebGLCommandBuffer).cmdPackage); // opted out
this.numDrawCalls += cmdBuff.numDrawCalls;
this.numInstances += cmdBuff.numInstances;
this.numTris += cmdBuff.numTris;
}
}
}
public clear () {
this.numDrawCalls = 0;
this.numInstances = 0;
this.numTris = 0;
}
}