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

#include <GrVkTextureRenderTarget.h>

Inheritance diagram for GrVkTextureRenderTarget:
GrVkTexture GrVkRenderTarget GrTexture GrRenderTarget GrSurface GrSurface GrGpuResource GrGpuResource GrIORef< GrGpuResource > GrIORef< GrGpuResource > SkNoncopyable SkNoncopyable

Public Member Functions

GrBackendFormat backendFormat () const override
 
- Public Member Functions inherited from GrVkTexture
 ~GrVkTexture () override
 
GrBackendTexture getBackendTexture () const override
 
GrBackendFormat backendFormat () const override
 
void textureParamsModified () override
 
GrVkImagetextureImage () const
 
const GrVkImageViewtextureView ()
 
const GrVkDescriptorSetcachedSingleDescSet (GrSamplerState)
 
void addDescriptorSetToCache (const GrVkDescriptorSet *, GrSamplerState)
 
- Public Member Functions inherited from GrTexture
GrTextureasTexture () override
 
const GrTextureasTexture () const override
 
virtual GrBackendTexture getBackendTexture () const =0
 
virtual void textureParamsModified ()=0
 
GrTextureType textureType () const
 
bool hasRestrictedSampling () const
 
void markMipmapsDirty ()
 
void markMipmapsClean ()
 
skgpu::Mipmapped mipmapped () const
 
bool mipmapsAreDirty () const
 
GrMipmapStatus mipmapStatus () const
 
int maxMipmapLevel () const
 
- Public Member Functions inherited from GrSurface
SkISize dimensions () const
 
int width () const
 
int height () const
 
SkRect getBoundsRect () const
 
virtual GrBackendFormat backendFormat () const =0
 
void setRelease (sk_sp< skgpu::RefCntedCallback > releaseHelper)
 
void setRelease (ReleaseProc proc, ReleaseCtx ctx)
 
virtual GrTextureasTexture ()
 
virtual const GrTextureasTexture () const
 
virtual GrRenderTargetasRenderTarget ()
 
virtual const GrRenderTargetasRenderTarget () const
 
GrInternalSurfaceFlags flags () const
 
bool readOnly () const
 
bool framebufferOnly () const
 
bool isProtected () const
 
void setFramebufferOnly ()
 
- Public Member Functions inherited from GrGpuResource
bool wasDestroyed () const
 
const GrDirectContextgetContext () const
 
GrDirectContextgetContext ()
 
size_t gpuMemorySize () const
 
UniqueID uniqueID () const
 
const skgpu::UniqueKeygetUniqueKey () const
 
std::string getLabel () const
 
void setLabel (std::string_view label)
 
CacheAccess cacheAccess ()
 
const CacheAccess cacheAccess () const
 
ProxyAccess proxyAccess ()
 
ResourcePriv resourcePriv ()
 
const ResourcePriv resourcePriv () const
 
virtual void dumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump) const
 
virtual const char * getResourceType () const =0
 
- Public Member Functions inherited from GrIORef< GrGpuResource >
bool unique () const
 
void ref () const
 
void unref () const
 
void refCommandBuffer () const
 
void unrefCommandBuffer () const
 
- Public Member Functions inherited from SkNoncopyable
 SkNoncopyable ()=default
 
 SkNoncopyable (SkNoncopyable &&)=default
 
SkNoncopyableoperator= (SkNoncopyable &&)=default
 
- Public Member Functions inherited from GrVkRenderTarget
 ~GrVkRenderTarget () override
 
GrBackendFormat backendFormat () const override
 
const GrVkFramebuffergetFramebuffer (bool withResolve, bool withStencil, SelfDependencyFlags selfDepFlags, LoadFromResolve)
 
const GrVkFramebuffergetFramebuffer (const GrVkRenderPass &renderPass)
 
GrVkImagecolorAttachment () const
 
const GrVkImageViewcolorAttachmentView () const
 
GrVkImageresolveAttachment () const
 
const GrVkImageViewresolveAttachmentView () const
 
GrVkImagenonMSAAAttachment () const
 
GrVkImageexternalAttachment () const
 
const GrVkRenderPassgetSimpleRenderPass (bool withResolve, bool withStencil, SelfDependencyFlags selfDepFlags, LoadFromResolve)
 
GrVkResourceProvider::CompatibleRPHandle compatibleRenderPassHandle (bool withResolve, bool withStencil, SelfDependencyFlags selfDepFlags, LoadFromResolve)
 
bool wrapsSecondaryCommandBuffer () const
 
sk_sp< GrVkFramebufferexternalFramebuffer () const
 
bool canAttemptStencilAttachment (bool useMSAASurface) const override
 
GrBackendRenderTarget getBackendRenderTarget () const override
 
bool getAttachmentsDescriptor (GrVkRenderPass::AttachmentsDescriptor *desc, GrVkRenderPass::AttachmentFlags *flags, bool withResolve, bool withStencil)
 
- Public Member Functions inherited from GrRenderTarget
virtual bool alwaysClearStencil () const
 
GrRenderTargetasRenderTarget () override
 
const GrRenderTargetasRenderTarget () const override
 
int numSamples () const
 
virtual GrBackendRenderTarget getBackendRenderTarget () const =0
 
GrAttachmentgetStencilAttachment (bool useMSAASurface) const
 
GrAttachmentgetStencilAttachment () const
 
virtual bool canAttemptStencilAttachment (bool useMSAASurface) const =0
 
void attachStencilAttachment (sk_sp< GrAttachment > stencil, bool useMSAASurface)
 
int numStencilBits (bool useMSAASurface) const
 
int getSamplePatternKey ()
 
const skia_private::TArray< SkPoint > & getSampleLocations ()
 
void setRequiresManualMSAAResolve ()
 
bool requiresManualMSAAResolve () const
 

Static Public Member Functions

static sk_sp< GrVkTextureRenderTargetMakeNewTextureRenderTarget (GrVkGpu *gpu, skgpu::Budgeted budgeted, SkISize dimensions, VkFormat format, uint32_t mipLevels, int sampleCnt, GrMipmapStatus mipmapStatus, GrProtected isProtected, std::string_view label)
 
static sk_sp< GrVkTextureRenderTargetMakeWrappedTextureRenderTarget (GrVkGpu *, SkISize dimensions, int sampleCnt, GrWrapOwnership, GrWrapCacheable, const GrVkImageInfo &, sk_sp< skgpu::MutableTextureState >)
 
- Static Public Member Functions inherited from GrVkTexture
static sk_sp< GrVkTextureMakeNewTexture (GrVkGpu *, skgpu::Budgeted budgeted, SkISize dimensions, VkFormat format, uint32_t mipLevels, GrProtected, GrMipmapStatus, std::string_view label)
 
static sk_sp< GrVkTextureMakeWrappedTexture (GrVkGpu *, SkISize dimensions, GrWrapOwnership, GrWrapCacheable, GrIOType, const GrVkImageInfo &, sk_sp< skgpu::MutableTextureState >)
 
- Static Public Member Functions inherited from GrTexture
static bool StealBackendTexture (sk_sp< GrTexture >, GrBackendTexture *, SkImages::BackendTextureReleaseProc *)
 
static void ComputeScratchKey (const GrCaps &caps, const GrBackendFormat &format, SkISize dimensions, GrRenderable, int sampleCnt, skgpu::Mipmapped, GrProtected, skgpu::ScratchKey *key)
 
- Static Public Member Functions inherited from GrSurface
static size_t ComputeSize (const GrBackendFormat &, SkISize dimensions, int colorSamplesPerPixel, skgpu::Mipmapped, bool binSize=false)
 
- Static Public Member Functions inherited from GrGpuResource
static uint32_t CreateUniqueID ()
 
- Static Public Member Functions inherited from GrVkRenderTarget
static sk_sp< GrVkRenderTargetMakeWrappedRenderTarget (GrVkGpu *, SkISize, int sampleCnt, const GrVkImageInfo &, sk_sp< skgpu::MutableTextureState >)
 
static sk_sp< GrVkRenderTargetMakeSecondaryCBRenderTarget (GrVkGpu *, SkISize, const GrVkDrawableInfo &vkInfo)
 
static void ReconstructAttachmentsDescriptor (const GrVkCaps &vkCaps, const GrProgramInfo &programInfo, GrVkRenderPass::AttachmentsDescriptor *desc, GrVkRenderPass::AttachmentFlags *flags)
 

Protected Member Functions

void onAbandon () override
 
void onRelease () override
 
- Protected Member Functions inherited from GrVkTexture
 GrVkTexture (GrVkGpu *, SkISize dimensions, sk_sp< GrVkImage > texture, GrMipmapStatus, std::string_view label)
 
GrVkGpugetVkGpu () const
 
void onAbandon () override
 
void onRelease () override
 
bool onStealBackendTexture (GrBackendTexture *, SkImages::BackendTextureReleaseProc *) override
 
void onSetRelease (sk_sp< RefCntedReleaseProc > releaseHelper) override
 
- Protected Member Functions inherited from GrTexture
 GrTexture (GrGpu *, const SkISize &, GrProtected, GrTextureType, GrMipmapStatus, std::string_view label)
 
virtual bool onStealBackendTexture (GrBackendTexture *, SkImages::BackendTextureReleaseProc *)=0
 
void computeScratchKey (skgpu::ScratchKey *) const override
 
- Protected Member Functions inherited from GrSurface
void setGLRTFBOIDIs0 ()
 
bool glRTFBOIDis0 () const
 
void setRequiresManualMSAAResolve ()
 
bool requiresManualMSAAResolve () const
 
void setReadOnly ()
 
void setVkRTSupportsInputAttachment ()
 
 GrSurface (GrGpu *gpu, const SkISize &dimensions, skgpu::Protected isProtected, std::string_view label)
 
 ~GrSurface () override
 
void onRelease () override
 
void onAbandon () override
 
- Protected Member Functions inherited from GrGpuResource
void registerWithCache (skgpu::Budgeted)
 
void registerWithCacheWrapped (GrWrapCacheable)
 
 GrGpuResource (GrGpu *, std::string_view label)
 
virtual ~GrGpuResource ()
 
GrGpugetGpu () const
 
virtual void onRelease ()
 
virtual void onAbandon ()
 
virtual void setMemoryBacking (SkTraceMemoryDump *, const SkString &) const
 
SkString getResourceName () const
 
void dumpMemoryStatisticsPriv (SkTraceMemoryDump *traceMemoryDump, const SkString &resourceName, const char *type, size_t size) const
 
- Protected Member Functions inherited from GrIORef< GrGpuResource >
 GrIORef ()
 
bool internalHasRef () const
 
bool internalHasNoCommandBufferUsages () const
 
void addInitialRef () const
 
- Protected Member Functions inherited from GrVkRenderTarget
 GrVkRenderTarget (GrVkGpu *gpu, SkISize dimensions, sk_sp< GrVkImage > colorAttachment, sk_sp< GrVkImage > resolveImage, CreateType createType, std::string_view label)
 
void onAbandon () override
 
void onRelease () override
 
size_t onGpuMemorySize () const override
 
void onSetLabel () override
 
- Protected Member Functions inherited from GrRenderTarget
 GrRenderTarget (GrGpu *, const SkISize &, int sampleCount, GrProtected, std::string_view label, sk_sp< GrAttachment > stenicl=nullptr)
 
 ~GrRenderTarget () override
 
void onAbandon () override
 
void onRelease () override
 

Additional Inherited Members

- Public Types inherited from GrSurface
typedef void * ReleaseCtx
 
typedef void(* ReleaseProc) (ReleaseCtx)
 
- Public Types inherited from GrIORef< GrGpuResource >
enum  LastRemovedRef
 
- Public Types inherited from GrVkRenderTarget
using SelfDependencyFlags = GrVkRenderPass::SelfDependencyFlags
 
using LoadFromResolve = GrVkRenderPass::LoadFromResolve
 
- Protected Types inherited from GrVkRenderTarget
enum class  CreateType { kDirectlyWrapped , kFromTextureRT }
 

Detailed Description

Definition at line 27 of file GrVkTextureRenderTarget.h.

Member Function Documentation

◆ backendFormat()

GrBackendFormat GrVkTextureRenderTarget::backendFormat ( ) const
inlineoverridevirtual

Reimplemented from GrVkRenderTarget.

Definition at line 48 of file GrVkTextureRenderTarget.h.

GrBackendFormat backendFormat() const override
Definition: GrVkTexture.h:46

◆ MakeNewTextureRenderTarget()

sk_sp< GrVkTextureRenderTarget > GrVkTextureRenderTarget::MakeNewTextureRenderTarget ( GrVkGpu gpu,
skgpu::Budgeted  budgeted,
SkISize  dimensions,
VkFormat  format,
uint32_t  mipLevels,
int  sampleCnt,
GrMipmapStatus  mipmapStatus,
GrProtected  isProtected,
std::string_view  label 
)
static

Definition at line 87 of file GrVkTextureRenderTarget.cpp.

96 {
99 format,
100 mipLevels,
102 /*numSamples=*/1,
103 budgeted,
105 if (!texture) {
106 return nullptr;
107 }
108
113 return nullptr;
114 }
116 SkASSERT(sampleCnt == 1 || resolveAttachment);
118 budgeted,
120 std::move(texture),
121 std::move(colorAttachment),
122 std::move(resolveAttachment),
124 label));
125}
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)
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkISize dimensions() const
Definition: GrSurface.h:27
bool isProtected() const
Definition: GrSurface.h:87
GrMipmapStatus mipmapStatus() const
Definition: GrTexture.h:66
static sk_sp< GrVkImage > MakeTexture(GrVkGpu *gpu, SkISize dimensions, VkFormat format, uint32_t mipLevels, GrRenderable renderable, int numSamples, skgpu::Budgeted budgeted, GrProtected isProtected)
Definition: GrVkImage.cpp:65
GrVkImage * colorAttachment() const
GrVkImage * resolveAttachment() const
uint32_t uint32_t * format
FlTexture * texture

◆ MakeWrappedTextureRenderTarget()

sk_sp< GrVkTextureRenderTarget > GrVkTextureRenderTarget::MakeWrappedTextureRenderTarget ( GrVkGpu gpu,
SkISize  dimensions,
int  sampleCnt,
GrWrapOwnership  wrapOwnership,
GrWrapCacheable  cacheable,
const GrVkImageInfo info,
sk_sp< skgpu::MutableTextureState mutableState 
)
static

Definition at line 127 of file GrVkTextureRenderTarget.cpp.

134 {
135 // Adopted textures require both image and allocation because we're responsible for freeing
136 SkASSERT(VK_NULL_HANDLE != info.fImage &&
137 (kBorrow_GrWrapOwnership == wrapOwnership || VK_NULL_HANDLE != info.fAlloc.fMemory));
138
140 if (info.fImageUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
142 }
143
146 info,
147 std::move(mutableState),
148 textureUsageFlags,
149 wrapOwnership,
150 cacheable,
151 "VkImage_MakeWrappedTextureRenderTarget");
152 if (!texture) {
153 return nullptr;
154 }
155
158 if (!create_rt_attachments(gpu, dimensions, info.fFormat, sampleCnt, info.fProtected, texture,
160 return nullptr;
161 }
163 SkASSERT(sampleCnt == 1 || resolveAttachment);
164
167
171 std::move(texture),
172 std::move(colorAttachment),
173 std::move(resolveAttachment),
175 cacheable,
176 /*label=*/"Vk_MakeWrappedTextureRenderTarget"));
177}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
GrMipmapStatus
Definition: GrTypesPriv.h:523
@ kBorrow_GrWrapOwnership
Definition: GrTypesPriv.h:79
static sk_sp< GrVkImage > MakeWrapped(GrVkGpu *gpu, SkISize dimensions, const GrVkImageInfo &, sk_sp< skgpu::MutableTextureState >, UsageFlags attachmentUsages, GrWrapOwnership, GrWrapCacheable, std::string_view label, bool forSecondaryCB=false)
Definition: GrVkImage.cpp:179
@ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
Definition: vulkan_core.h:2356
#define VK_NULL_HANDLE
Definition: vulkan_core.h:46

◆ onAbandon()

void GrVkTextureRenderTarget::onAbandon ( )
inlineoverrideprotectedvirtual

Overridden to abandon any internal handles, ptrs, etc to backend API resources. This may be called when the underlying 3D context is no longer valid and so no backend API calls should be made.

Reimplemented from GrVkRenderTarget.

Definition at line 51 of file GrVkTextureRenderTarget.h.

51 {
52 // In order to correctly handle calling texture idle procs, GrVkTexture must go first.
55 }
void onAbandon() override
void onAbandon() override

◆ onRelease()

void GrVkTextureRenderTarget::onRelease ( )
inlineoverrideprotectedvirtual

Overridden to free GPU resources in the backend API.

Reimplemented from GrVkRenderTarget.

Definition at line 57 of file GrVkTextureRenderTarget.h.

57 {
58 // In order to correctly handle calling texture idle procs, GrVkTexture must go first.
61 }
void onRelease() override
void onRelease() override

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