22#define VK_CALL(GPU, X) GR_VK_CALL(GPU->vkInterface(), X)
30 std::string_view label)
42 , fDescSetCache(kMaxCachedDescSets) {
45 SkASSERT(!fTexture->ycbcrConversionInfo().isValid() ||
46 !fTexture->ycbcrConversionInfo().fExternalFormat);
48 this->registerWithCache(budgeted);
61 std::string_view label)
73 , fDescSetCache(kMaxCachedDescSets) {
79 this->registerWithCacheWrapped(cacheable);
87 std::string_view label)
99 , fDescSetCache(kMaxCachedDescSets) {
114 std::string_view label) {
137 std::move(mutableState),
141 "VkImage_MakeWrappedTexture");
149 bool isExternal =
info.fYcbcrConversionInfo.isValid() &&
150 (
info.fYcbcrConversionInfo.fExternalFormat != 0);
159 "Vk_MakeWrappedTexture"));
170 fDescSetCache.reset();
191 fDescSetCache.reset();
211 if (std::unique_ptr<DescriptorCacheEntry>*
e = fDescSetCache.find(
state)) {
212 return (*e)->fDescriptorSet;
220 fDescSetCache.insert(
state, std::make_unique<DescriptorCacheEntry>(descSet, this->
getVkGpu()));
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kBorrow_GrWrapOwnership
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
static constexpr bool SkToBool(const T &x)
bool wasDestroyed() const
SkISize dimensions() const
void onAbandon() override
void onRelease() override
GrMipmapStatus mipmapStatus() const
const GrVkImageView * textureView() const
uint32_t mipLevels() const
sk_sp< skgpu::MutableTextureState > getMutableState() const
VkImageUsageFlags vkUsageFlags()
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)
const skgpu::VulkanYcbcrConversionInfo & ycbcrConversionInfo() const
static sk_sp< GrVkImage > MakeTexture(GrVkGpu *gpu, SkISize dimensions, VkFormat format, uint32_t mipLevels, GrRenderable renderable, int numSamples, skgpu::Budgeted budgeted, GrProtected isProtected)
const GrVkImageInfo & vkImageInfo() const
GrBackendTexture getBackendTexture() const override
void onRelease() override
const GrVkImageView * textureView()
GrVkGpu * getVkGpu() const
void onAbandon() override
const GrVkDescriptorSet * cachedSingleDescSet(GrSamplerState)
void addDescriptorSetToCache(const GrVkDescriptorSet *, GrSamplerState)
GrVkTexture(GrVkGpu *, SkISize dimensions, sk_sp< GrVkImage > texture, GrMipmapStatus, std::string_view label)
static sk_sp< GrVkTexture > MakeWrappedTexture(GrVkGpu *, SkISize dimensions, GrWrapOwnership, GrWrapCacheable, GrIOType, const GrVkImageInfo &, sk_sp< skgpu::MutableTextureState >)
static sk_sp< GrVkTexture > MakeNewTexture(GrVkGpu *, skgpu::Budgeted budgeted, SkISize dimensions, VkFormat format, uint32_t mipLevels, GrProtected, GrMipmapStatus, std::string_view label)
void reset(T *ptr=nullptr)
uint32_t uint32_t * format
SK_API GrBackendTexture MakeVk(int width, int height, const GrVkImageInfo &, std::string_view label={})
static constexpr bool VkFormatIsCompressed(VkFormat vkFormat)
const GrVkDescriptorSet * fDescriptorSet
DescriptorCacheEntry(const GrVkDescriptorSet *fDescSet, GrVkGpu *gpu)
@ VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
@ VK_IMAGE_USAGE_SAMPLED_BIT