mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 10:32:39 +08:00
c2e3de2caa
* public interfaces: render pass, IA, PSO * public interfaces: Queue, Sampler, Shader, DSLayout * public interfaces: DS, CB, Texture, Buffer, Device * public interfaces: other supporting structs * fix framebuffer state cache
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { GFXCommandBuffer } from '../command-buffer';
|
|
import { GFXQueue, GFXQueueInfo } 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: GFXQueueInfo): 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;
|
|
}
|
|
}
|