智能客服
你问我答,随时在线为你解决问题
Class Info |
|---|
class CommandBuffer 命令缓冲类,用于命令缓存区的有关操作。 |
Constructor Name |
|---|
| 构造函数。 |
Destructor Name |
|---|
virtual ~CommandBuffer() 析构函数。 |
Qualifier and Type |
Method Name and Description |
|---|---|
virtual void |
SetPipelineBarrier(const BufferMemoryBarrier* bufferMemoryBarrier) = 0 根据BufferMemoryBarrier信息创建管线屏障。 |
virtual void |
SetPipelineBarrier(const TextureMemoryBarrier* textureMemoryBarrier, const Texture* texture) = 0 根据TextureMemoryBarrier信息为Texture创建管线屏障。 |
virtual void |
BeginRenderPass(const ClearValue& clearValue, const Viewport& viewPort, const RenderPass* renderPass, const FrameBuffer* frameBuffer, SubpassContents subpassContents) = 0 渲染通道相关流程开始执行。 |
virtual void |
EndRenderPass() = 0 渲染通道流程执行结束。 |
virtual bool |
BeginCommand(const RenderPass* renderPass = nullptr, const FrameBuffer* frameBuffer = nullptr) = 0 开始执行渲染指令。 |
virtual void |
EndCommand() = 0 渲染指令执行结束。 |
virtual void |
BindViewport(const Viewport& viewport) = 0 视口绑定。 |
virtual void |
BindScissorRect(s32 x, s32 y, u32 width, u32 height) = 0 绑定裁剪矩形。 |
virtual void |
SetVertexBuffer(const std::vector<DynamicBuffer*>& vertexBuffers) = 0 设置顶点缓冲。 |
virtual void |
SetIndexBuffer(const Buffer* indexBuffer, u32 stride) = 0 设置索引缓冲。 |
virtual void |
SetPipeline(const Pipeline* pipeline) = 0 设置渲染管线。 |
virtual void |
BindDescriptorSets(const std::map<u32, DescriptorSet*>& descriptorSets) = 0 绑定描述符。 |
virtual void |
PushConstant(Pipeline* pipeline, ShaderStageType type, const void* values, u32 offset, u32 size) = 0 推式常量操作,给定参数进行设置。 |
virtual void |
绘制接口。 |
virtual void |
DrawIndexed(u32 indexCount, u32 indexOffset, u32 vertexOffset) = 0 根据索引缓冲绘制 |
virtual void |
ExecuteCommand(CommandBuffer* secondaryCommandBuffer) = 0 执行指令接口。 |
virtual void |
Reset() = 0 重置缓冲。 |
virtual void |
NextSubpass() = 0 执行下一步渲染流程。 |
virtual void |
SetLineWidth(f32 width) = 0 设置线宽。 |
virtual u8* |
CopyTextureToBuffer(const void* imageView, u8* buffer, u32 width, u32 height) = 0 将纹理拷贝到缓冲。 |
virtual void |
SetStencilTestEnable(bool bEnable) = 0 模板测试使能接口。 |
virtual void |
SetStencilCompareMask(StencilFaceFlag stencilFaceFlag, u32 mask) = 0 设置模板测试的对比掩码。 |
virtual void |
SetStencilReference(StencilFaceFlag stencilFaceFlag, u32 ref) = 0 设置模板测试的引用。 |
virtual void |
SetStencilWriteMask(StencilFaceFlag stencilFaceFlag, u32 mask) = 0 设置模板测试的写掩码。 |
virtual void |
SetBlendConstants(const std::vector<f32>& blendConstants) = 0 设置混合常数数值。 |
bool |
Create(const CommandBufferCreateInfo& commandBufferCreateInfo) 根据CommandBufferCreateInfo信息创建命令缓冲。 |
const CommandBufferCreateInfo& |
GetCommandBufferCreateInfo() const 获取命令缓冲的创建信息。 |
bool |
isRecorded() const 是否已记录。 |
void |
SetRecordedStatus(bool status) 设置记录状态。 |
Constructor |
|---|
CommandBuffer(const GraphicsRenderer* graphicsRenderer); 构造函数。 |
Parameters
Name |
Description |
|---|---|
graphicsRenderer |
图形渲染器。 |
Destructor |
|---|
virtual ~CommandBuffer() 析构函数。 |
Method |
|---|
virtual void SetPipelineBarrier(const BufferMemoryBarrier* bufferMemoryBarrier) = 0 根据BufferMemoryBarrier信息创建管线屏障。 |
Parameters
Name |
Description |
|---|---|
bufferMemoryBarrier |
Method |
|---|
virtual void SetPipelineBarrier(const TextureMemoryBarrier* textureMemoryBarrier, const Texture* texture) = 0 根据TextureMemoryBarrier信息为Texture创建管线屏障。 |
Parameters
Name |
Description |
|---|---|
textureMemoryBarrier |
|
texture |
Texture信息。 |
Method |
|---|
virtual void BeginRenderPass(const ClearValue& clearValue, const Viewport& viewPort, const RenderPass* renderPass, const FrameBuffer* frameBuffer,SubpassContents subpassContents) = 0 渲染通道相关流程开始执行。 |
Parameters
Name |
Description |
|---|---|
clearValue |
ClearValue信息。 |
viewPort |
Viewport信息。 |
renderPass |
RenderPass信息。 |
frameBuffer |
FrameBuffer信息。 |
subpassContents |
子通道内容信息。 |
Method |
|---|
virtual void EndRenderPass() = 0 渲染通道流程执行结束。 |
Method |
|---|
virtual bool BeginCommand(const RenderPass* renderPass = nullptr, const FrameBuffer* frameBuffer = nullptr) = 0 开始执行渲染指令。 |
Parameters
Name |
Description |
|---|---|
renderPass |
RenderPass信息。 |
frameBuffer |
FrameBuffer信息。 |
Returns
Type |
Description |
|---|---|
bool |
开始命令缓冲操作,成功则返回true,否则为false。 |
Method |
|---|
virtual void EndCommand() = 0 渲染指令执行结束。 |
Method |
|---|
virtual void BindViewport(const Viewport& viewport) = 0 视口绑定。 |
Parameters
Name |
Description |
|---|---|
viewport |
Viewport信息。 |
Parameters
Name |
Description |
|---|---|
x |
x坐标。 |
y |
y坐标。 |
width |
矩阵的宽。 |
height |
矩阵的高。 |
Method |
|---|
virtual void SetVertexBuffer(const std::vector<DynamicBuffer*>& vertexBuffers) = 0 设置顶点缓冲。 |
Parameters
Name |
Description |
|---|---|
vertexBuffers |
顶点缓冲信息。 |
Parameters
Name |
Description |
|---|---|
indexBuffer |
缓冲信息。 |
stride |
对应的步长。 |
Method |
|---|
virtual void SetPipeline(const Pipeline* pipeline) = 0 设置渲染管线。 |
Parameters
Name |
Description |
|---|---|
pipeline |
渲染管线信息。 |
Method |
|---|
virtual void BindDescriptorSets(const std::map<u32, DescriptorSet*>& descriptorSets) = 0 绑定描述符。 |
Parameters
Name |
Description |
|---|---|
descriptorSets |
需要绑定的DescriptorSet列表。 |
Method |
|---|
virtual void PushConstant(Pipeline* pipeline, ShaderStageType type, const void* values, u32 offset, u32 size) = 0 推式常量操作,给定参数进行设置。 |
Parameters
Name |
Description |
|---|---|
pipeline |
渲染管线。 |
type |
shader阶段,如顶点阶段或者片元阶段等。 |
values |
具体常量内容。 |
offset |
偏移量。 |
size |
常量内容大小。 |
Method |
|---|
virtual void Draw( u32 vertexCount) = 0 绘制接口。 |
Parameters
Name |
Description |
|---|---|
vertexCount |
顶点个数。 |
Parameters
Name |
Description |
|---|---|
indexCount |
索引个数。 |
indexOffset |
索引偏移量。 |
vertexOffset |
顶点偏移量。 |
Method |
|---|
virtual void ExecuteCommand(CommandBuffer* secondaryCommandBuffer) = 0 执行指令接口。 |
Parameters
Name |
Description |
|---|---|
secondaryCommandBuffer |
要被执行的指令。 |
Method |
|---|
virtual void Reset() = 0 重置缓冲。 |
Method |
|---|
virtual void NextSubpass() = 0 执行下一步渲染流程。 |
Method |
|---|
virtual void SetLineWidth(f32 width) = 0 设置线宽。 |
Parameters
Name |
Description |
|---|---|
width |
线的宽度。 |
Parameters
Name |
Description |
|---|---|
imageView |
图像视图。 |
buffer |
图像缓冲。 |
width |
图像的宽度 |
height |
图像的高度 |
Returns
Type |
Description |
|---|---|
u8* |
图像缓冲地址。 |
Method |
|---|
virtual void SetStencilTestEnable(bool bEnable) = 0 模板测试使能接口。 |
Parameters
Name |
Description |
|---|---|
bEnable |
|
Method |
|---|
virtual void SetStencilCompareMask(StencilFaceFlag stencilFaceFlag, u32 mask) = 0 设置模板测试的对比掩码。 |
Parameters
Name |
Description |
|---|---|
stencilFaceFlag |
模板比较作用范围,正面或背面或者双面。 |
mask |
模板比较新设置的掩码值。 |
Method |
|---|
virtual void SetStencilReference(StencilFaceFlag stencilFaceFlag, u32 ref) = 0 设置模板测试的引用。 |
Parameters
Name |
Description |
|---|---|
stencilFaceFlag |
模板比较作用范围,正面或背面或者双面。 |
ref |
模板引用新设置的值。 |
Method |
|---|
virtual void SetStencilWriteMask(StencilFaceFlag stencilFaceFlag, u32 mask) = 0 设置模板测试的写掩码。 |
Parameters
Name |
Description |
|---|---|
stencilFaceFlag |
模板比较作用范围,正面或背面或者双面。 |
mask |
模板写入新设置的掩码值。 |
Method |
|---|
virtual void SetBlendConstants(const std::vector<f32>& blendConstants) = 0 设置混合常数数值。 |
Parameters
Name |
Description |
|---|---|
blendConstants |
混合常数数值。 |
Method |
|---|
bool Create(const CommandBufferCreateInfo& commandBufferCreateInfo) 创建命令缓冲。 |
Parameters
Name |
Description |
|---|---|
commandBufferCreateInfo |
命令缓冲创建信息。 |
Returns
Type |
Description |
|---|---|
bool |
创建命令缓冲是否成功。true,成功;false,失败。 |
Method |
|---|
const CommandBufferCreateInfo& GetCommandBufferCreateInfo() const 获取命令缓冲的创建信息。 |
Returns
Type |
Description |
|---|---|
命令缓冲创建信息。 |
Method |
|---|
bool isRecorded() const 是否已记录。 |
Returns
Type |
Description |
|---|---|
bool |
是否已记录。
|
Method |
|---|
void SetRecordedStatus(bool status) 设置记录状态。 |
Parameters
Name |
Description |
|---|---|
status |
记录的状态。 |