Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
GrVkFramebuffer Class Reference

#include <GrVkFramebuffer.h>

Inheritance diagram for GrVkFramebuffer:
GrVkManagedResource GrManagedResource SkNoncopyable

Public Member Functions

 GrVkFramebuffer (const GrVkGpu *gpu, sk_sp< GrVkImage > colorAttachment, sk_sp< const GrVkRenderPass > renderPass, std::unique_ptr< GrVkSecondaryCommandBuffer >)
 
VkFramebuffer framebuffer () const
 
bool isExternal () const
 
const GrVkRenderPassexternalRenderPass () const
 
std::unique_ptr< GrVkSecondaryCommandBufferexternalCommandBuffer ()
 
void returnExternalGrSecondaryCommandBuffer (std::unique_ptr< GrVkSecondaryCommandBuffer >)
 
const GrVkRenderPasscompatibleRenderPass () const
 
GrVkResourceProvider::CompatibleRPHandle compatibleRenderPassHandle () const
 
GrVkImagecolorAttachment ()
 
GrVkImageresolveAttachment ()
 
GrVkImagestencilAttachment ()
 
- Public Member Functions inherited from GrVkManagedResource
 GrVkManagedResource (const GrVkGpu *gpu)
 
- Public Member Functions inherited from GrManagedResource
 GrManagedResource ()
 
virtual ~GrManagedResource ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< const GrVkFramebufferMake (GrVkGpu *gpu, SkISize dimensions, sk_sp< const GrVkRenderPass > compatibleRenderPass, GrVkImage *colorAttachment, GrVkImage *resolveAttachment, GrVkImage *stencilAttachment, GrVkResourceProvider::CompatibleRPHandle)
 

Additional Inherited Members

- Protected Attributes inherited from GrVkManagedResource
const GrVkGpufGpu
 

Detailed Description

Definition at line 23 of file GrVkFramebuffer.h.

Constructor & Destructor Documentation

◆ GrVkFramebuffer()

GrVkFramebuffer::GrVkFramebuffer ( const GrVkGpu gpu,
sk_sp< GrVkImage colorAttachment,
sk_sp< const GrVkRenderPass renderPass,
std::unique_ptr< GrVkSecondaryCommandBuffer externalCommandBuffer 
)

Definition at line 81 of file GrVkFramebuffer.cpp.

86 , fColorAttachment(std::move(colorAttachment))
87 , fExternalRenderPass(std::move(renderPass))
88 , fExternalCommandBuffer(std::move(externalCommandBuffer)) {}
GrVkImage * colorAttachment()
std::unique_ptr< GrVkSecondaryCommandBuffer > externalCommandBuffer()
GrVkManagedResource(const GrVkGpu *gpu)

Member Function Documentation

◆ colorAttachment()

GrVkImage * GrVkFramebuffer::colorAttachment ( )
inline

Definition at line 73 of file GrVkFramebuffer.h.

73{ return fColorAttachment.get(); }
T * get() const
Definition: SkRefCnt.h:303

◆ compatibleRenderPass()

const GrVkRenderPass * GrVkFramebuffer::compatibleRenderPass ( ) const
inline

Definition at line 67 of file GrVkFramebuffer.h.

67{ return fCompatibleRenderPass.get(); }

◆ compatibleRenderPassHandle()

GrVkResourceProvider::CompatibleRPHandle GrVkFramebuffer::compatibleRenderPassHandle ( ) const
inline

Definition at line 69 of file GrVkFramebuffer.h.

69 {
70 return fCompatibleRenderPassHandle;
71 }

◆ externalCommandBuffer()

std::unique_ptr< GrVkSecondaryCommandBuffer > GrVkFramebuffer::externalCommandBuffer ( )

Definition at line 118 of file GrVkFramebuffer.cpp.

118 {
119 SkASSERT(fExternalCommandBuffer);
120 return std::move(fExternalCommandBuffer);
121}
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ externalRenderPass()

const GrVkRenderPass * GrVkFramebuffer::externalRenderPass ( ) const
inline

Definition at line 45 of file GrVkFramebuffer.h.

45{ return fExternalRenderPass.get(); }

◆ framebuffer()

VkFramebuffer GrVkFramebuffer::framebuffer ( ) const
inline

Definition at line 39 of file GrVkFramebuffer.h.

39 {
40 SkASSERT(!this->isExternal());
41 return fFramebuffer;
42 }
bool isExternal() const

◆ isExternal()

bool GrVkFramebuffer::isExternal ( ) const
inline

Definition at line 44 of file GrVkFramebuffer.h.

44{ return fExternalRenderPass.get(); }

◆ Make()

sk_sp< const GrVkFramebuffer > GrVkFramebuffer::Make ( GrVkGpu gpu,
SkISize  dimensions,
sk_sp< const GrVkRenderPass compatibleRenderPass,
GrVkImage colorAttachment,
GrVkImage resolveAttachment,
GrVkImage stencilAttachment,
GrVkResourceProvider::CompatibleRPHandle  compatibleRenderPassHandle 
)
static

Definition at line 16 of file GrVkFramebuffer.cpp.

23 {
24 // At the very least we need a renderPass and a colorAttachment
27
28 VkImageView attachments[3];
29 attachments[0] = colorAttachment->framebufferView()->imageView();
30 int numAttachments = 1;
32 attachments[numAttachments++] = resolveAttachment->framebufferView()->imageView();
33 }
35 attachments[numAttachments++] = stencilAttachment->framebufferView()->imageView();
36 }
37
38 VkFramebufferCreateInfo createInfo;
39 memset(&createInfo, 0, sizeof(VkFramebufferCreateInfo));
41 createInfo.pNext = nullptr;
42 createInfo.flags = 0;
44 createInfo.attachmentCount = numAttachments;
45 createInfo.pAttachments = attachments;
46 createInfo.width = dimensions.width();
47 createInfo.height = dimensions.height();
48 createInfo.layers = 1;
49
50 VkFramebuffer framebuffer;
51 VkResult err;
52 GR_VK_CALL_RESULT(gpu, err, CreateFramebuffer(gpu->device(), &createInfo, nullptr,
53 &framebuffer));
54 if (err) {
55 return nullptr;
56 }
57
62}
#define GR_VK_CALL_RESULT(GPU, RESULT, X)
Definition: GrVkUtil.h:35
sk_sp< T > sk_ref_sp(T *obj)
Definition: SkRefCnt.h:381
const GrVkRenderPass * compatibleRenderPass() const
GrVkResourceProvider::CompatibleRPHandle compatibleRenderPassHandle() const
GrVkFramebuffer(const GrVkGpu *gpu, sk_sp< GrVkImage > colorAttachment, sk_sp< const GrVkRenderPass > renderPass, std::unique_ptr< GrVkSecondaryCommandBuffer >)
GrVkImage * resolveAttachment()
VkFramebuffer framebuffer() const
GrVkImage * stencilAttachment()
VkDevice device() const
Definition: GrVkGpu.h:71
VkImageView imageView() const
Definition: GrVkImageView.h:33
const GrVkImageView * framebufferView() const
Definition: GrVkImage.h:106
VkRenderPass vkRenderPass() const
constexpr int32_t width() const
Definition: SkSize.h:36
constexpr int32_t height() const
Definition: SkSize.h:37
const VkImageView * pAttachments
Definition: vulkan_core.h:3823
VkStructureType sType
Definition: vulkan_core.h:3818
VkFramebufferCreateFlags flags
Definition: vulkan_core.h:3820
VkResult
Definition: vulkan_core.h:140
@ VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
Definition: vulkan_core.h:239

◆ resolveAttachment()

GrVkImage * GrVkFramebuffer::resolveAttachment ( )
inline

Definition at line 74 of file GrVkFramebuffer.h.

74{ return fResolveAttachment.get(); }

◆ returnExternalGrSecondaryCommandBuffer()

void GrVkFramebuffer::returnExternalGrSecondaryCommandBuffer ( std::unique_ptr< GrVkSecondaryCommandBuffer cmdBuffer)

Definition at line 112 of file GrVkFramebuffer.cpp.

113 {
114 SkASSERT(!fExternalCommandBuffer);
115 fExternalCommandBuffer = std::move(cmdBuffer);
116}

◆ stencilAttachment()

GrVkImage * GrVkFramebuffer::stencilAttachment ( )
inline

Definition at line 75 of file GrVkFramebuffer.h.

75{ return fStencilAttachment.get(); }

The documentation for this class was generated from the following files: