Flutter Engine
The Flutter Engine
Macros | Functions
GrVkTextureRenderTarget.cpp File Reference
#include "src/gpu/ganesh/vk/GrVkTextureRenderTarget.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrResourceProvider.h"
#include "src/gpu/ganesh/GrTexture.h"
#include "src/gpu/ganesh/vk/GrVkGpu.h"
#include "src/gpu/ganesh/vk/GrVkImage.h"
#include "src/gpu/ganesh/vk/GrVkImageView.h"
#include "src/gpu/ganesh/vk/GrVkUtil.h"
#include "src/core/SkMipmap.h"
#include "include/gpu/ganesh/vk/GrVkBackendSurface.h"
#include "include/gpu/vk/GrVkTypes.h"

Go to the source code of this file.

Macros

#define VK_CALL(GPU, X)   GR_VK_CALL(GPU->vkInterface(), X)
 

Functions

bool create_rt_attachments (GrVkGpu *gpu, SkISize dimensions, VkFormat format, int sampleCnt, GrProtected isProtected, sk_sp< GrVkImage > texture, sk_sp< GrVkImage > *colorAttachment, sk_sp< GrVkImage > *resolveAttachment)
 

Macro Definition Documentation

◆ VK_CALL

#define VK_CALL (   GPU,
  X 
)    GR_VK_CALL(GPU->vkInterface(), X)

Definition at line 23 of file GrVkTextureRenderTarget.cpp.

Function Documentation

◆ create_rt_attachments()

bool create_rt_attachments ( GrVkGpu gpu,
SkISize  dimensions,
VkFormat  format,
int  sampleCnt,
GrProtected  isProtected,
sk_sp< GrVkImage texture,
sk_sp< GrVkImage > *  colorAttachment,
sk_sp< GrVkImage > *  resolveAttachment 
)

Definition at line 66 of file GrVkTextureRenderTarget.cpp.

70 {
71 if (sampleCnt > 1) {
72 auto rp = gpu->getContext()->priv().resourceProvider();
73 sk_sp<GrAttachment> msaaAttachment = rp->makeMSAAAttachment(
74 dimensions, GrBackendFormats::MakeVk(format), sampleCnt, isProtected,
76 if (!msaaAttachment) {
77 return false;
78 }
79 *colorAttachment = sk_sp<GrVkImage>(static_cast<GrVkImage*>(msaaAttachment.release()));
80 *resolveAttachment = std::move(texture);
81 } else {
82 *colorAttachment = std::move(texture);
83 }
84 return true;
85}
GrResourceProvider * resourceProvider()
GrDirectContextPriv priv()
GrDirectContext * getContext()
Definition: GrGpu.h:67
T * release()
Definition: SkRefCnt.h:324
uint32_t uint32_t * format
FlTexture * texture
SK_API GrBackendFormat MakeVk(VkFormat format, bool willUseDRMFormatModifiers=false)