mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
7481303268
# Conflicts: # cocos/core/3d/framework/camera-component.ts # cocos/core/assets/mesh.ts # cocos/core/components/component-event-handler.ts # cocos/core/game.ts # cocos/core/gfx/webgl/webgl-commands.ts # cocos/core/gfx/webgl2/webgl2-commands.ts # cocos/core/pipeline/define.ts # cocos/core/pipeline/forward/forward-pipeline.ts # cocos/core/pipeline/instanced-buffer.ts # cocos/core/pipeline/render-pipeline.ts # cocos/core/pipeline/shadow/shadow-flow.ts # cocos/core/renderer/scene/model.ts # cocos/core/renderer/scene/shadows.ts # cocos/core/renderer/scene/skybox.ts # cocos/core/splash-screen.ts # cocos/ui/components/button.ts # cocos/ui/components/editbox/edit-box-impl.ts # editor/assets/primitives.fbx # package-lock.json # package.json
58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
/**
|
|
* @packageDocumentation
|
|
* @module gfx
|
|
*/
|
|
|
|
import { GFXCommandBuffer } from './command-buffer';
|
|
import { GFXObject, GFXObjectType, GFXQueueType } from './define';
|
|
import { GFXDevice } from './device';
|
|
import { GFXFence } from './fence';
|
|
|
|
export class GFXQueueInfo {
|
|
declare private token: never; // to make sure all usages must be an instance of this exact class, not assembled from plain object
|
|
|
|
constructor (
|
|
public type: GFXQueueType = GFXQueueType.GRAPHICS,
|
|
) {}
|
|
}
|
|
|
|
/**
|
|
* @en GFX Queue.
|
|
* @zh GFX 队列。
|
|
*/
|
|
export abstract class GFXQueue extends GFXObject {
|
|
|
|
/**
|
|
* @en Get current type.
|
|
* @zh 队列类型。
|
|
*/
|
|
get type (): number {
|
|
return this._type;
|
|
}
|
|
|
|
protected _device: GFXDevice;
|
|
|
|
protected _type: GFXQueueType = GFXQueueType.GRAPHICS;
|
|
|
|
protected _isAsync = false;
|
|
|
|
constructor (device: GFXDevice) {
|
|
super(GFXObjectType.QUEUE);
|
|
this._device = device;
|
|
}
|
|
|
|
public abstract initialize (info: GFXQueueInfo): boolean;
|
|
|
|
public abstract destroy (): void;
|
|
|
|
public isAsync () { return this._isAsync; }
|
|
|
|
/**
|
|
* @en Submit command buffers.
|
|
* @zh 提交命令缓冲数组。
|
|
* @param cmdBuffs The command buffers to be submitted.
|
|
* @param fence The syncing fence.
|
|
*/
|
|
public abstract submit (cmdBuffs: GFXCommandBuffer[], fence?: GFXFence): void;
|
|
}
|