Flutter Engine
The Flutter Engine
Public Attributes | List of all members
GrVkDrawableInfo Struct Reference

#include <GrVkTypes.h>

Public Attributes

VkCommandBuffer fSecondaryCommandBuffer
 
uint32_t fColorAttachmentIndex
 
VkRenderPass fCompatibleRenderPass
 
VkFormat fFormat
 
VkRect2DfDrawBounds
 

Detailed Description

This object is wrapped in a GrBackendDrawableInfo and passed in as an argument to drawBackendGpu() calls on an SkDrawable. The drawable will use this info to inject direct Vulkan calls into our stream of GPU draws.

The SkDrawable is given a secondary VkCommandBuffer in which to record draws. The GPU backend will then execute that command buffer within a render pass it is using for its own draws. The drawable is also given the attachment of the color index, a compatible VkRenderPass, and the VkFormat of the color attachment so that it can make VkPipeline objects for the draws. The SkDrawable must not alter the state of the VkRenderpass or sub pass.

Additionally, the SkDrawable may fill in the passed in fDrawBounds with the bounds of the draws that it submits to the command buffer. This will be used by the GPU backend for setting the bounds in vkCmdBeginRenderPass. If fDrawBounds is not updated, we will assume that the entire attachment may have been written to.

The SkDrawable is always allowed to create its own command buffers and submit them to the queue to render offscreen textures which will be sampled in draws added to the passed in VkCommandBuffer. If this is done the SkDrawable is in charge of adding the required memory barriers to the queue for the sampled images since the Skia backend will not do this.

Definition at line 84 of file GrVkTypes.h.

Member Data Documentation

◆ fColorAttachmentIndex

uint32_t GrVkDrawableInfo::fColorAttachmentIndex

Definition at line 86 of file GrVkTypes.h.

◆ fCompatibleRenderPass

VkRenderPass GrVkDrawableInfo::fCompatibleRenderPass

Definition at line 87 of file GrVkTypes.h.

◆ fDrawBounds

VkRect2D* GrVkDrawableInfo::fDrawBounds

Definition at line 89 of file GrVkTypes.h.

◆ fFormat

VkFormat GrVkDrawableInfo::fFormat

Definition at line 88 of file GrVkTypes.h.

◆ fSecondaryCommandBuffer

VkCommandBuffer GrVkDrawableInfo::fSecondaryCommandBuffer

Definition at line 85 of file GrVkTypes.h.


The documentation for this struct was generated from the following file: