mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:03:09 +08:00
38 lines
976 B
TypeScript
38 lines
976 B
TypeScript
import { GFXDevice } from '../device';
|
|
import { GFXQueueInfo, GFXQueue } from '../queue';
|
|
import { GFXCommandBuffer } from '../command-buffer';
|
|
import { WebGLGFXCommandBuffer } from './webgl-command-buffer';
|
|
import { WebGLCmdFuncExecuteCmds } from './webgl-commands';
|
|
import { WebGLGFXDevice } from './webgl-device';
|
|
|
|
export class WebGLGFXQueue extends GFXQueue {
|
|
|
|
constructor(device: GFXDevice) {
|
|
super(device);
|
|
}
|
|
|
|
public initialize(info: GFXQueueInfo): boolean {
|
|
|
|
this._type = info.type;
|
|
|
|
return true;
|
|
}
|
|
|
|
public destroy() {
|
|
|
|
}
|
|
|
|
public submit(cmdBuffs: GFXCommandBuffer[], fence?) {
|
|
|
|
// TODO: Async
|
|
if (!this._isAsync) {
|
|
for (let i = 0; i < cmdBuffs.length; ++i) {
|
|
let cmdBuff = <WebGLGFXCommandBuffer>cmdBuffs[i];
|
|
WebGLCmdFuncExecuteCmds(<WebGLGFXDevice>this._device, cmdBuff.cmdPackage);
|
|
}
|
|
}
|
|
}
|
|
|
|
private _isAsync: boolean = false;
|
|
};
|