471 {
472 if (0 == imageDesc.fWidth || 0 == imageDesc.fHeight) {
473 return false;
474 }
477 return false;
478 }
479
483
484
487 return false;
488 }
489
492
496 }
499 nullptr,
500 createflags,
501 imageDesc.fImageType,
502 imageDesc.fFormat,
503 { imageDesc.fWidth, imageDesc.fHeight, 1 },
504 imageDesc.fLevels,
505 1,
506 vkSamples,
507 imageDesc.fImageTiling,
508 imageDesc.fUsageFlags,
510 0,
511 nullptr,
512 initialLayout
513 };
514
519 return false;
520 }
521
525 bool useLazyAllocation =
527
528 auto checkResult = [gpu,
isProtected, forceDedicatedMemory, useLazyAllocation](
531 " (isProtected:%d, forceDedicatedMemory:%d, useLazyAllocation:%d)",
533 (int)useLazyAllocation);
535 };
541 forceDedicatedMemory,
542 useLazyAllocation,
543 checkResult,
545 (useLazyAllocation &&
548 return false;
549 }
550
551
559 return false;
560 }
561
564 info->fImageTiling = imageDesc.fImageTiling;
565 info->fImageLayout = initialLayout;
566 info->fFormat = imageDesc.fFormat;
567 info->fImageUsageFlags = imageDesc.fUsageFlags;
568 info->fSampleCount = imageDesc.fSamples;
569 info->fLevelCount = imageDesc.fLevels;
574 return true;
575}
#define GR_VK_LOG_IF_NOT_SUCCESS(GPU, RESULT, X,...)
#define GR_VK_CALL_RESULT(GPU, RESULT, X)
static constexpr bool SkToBool(const T &x)
bool supportsProtectedContent() const
bool shouldAlwaysUseDedicatedImageMemory() const
const GrVkCaps & vkCaps() const
bool protectedContext() const
bool checkVkResult(VkResult)
const skgpu::VulkanAlloc & alloc() const
bool AllocImageMemory(VulkanMemoryAllocator *, VkImage image, skgpu::Protected isProtected, bool forceDedicatedMemory, bool useLazyAllocation, const std::function< CheckResult > &, VulkanAlloc *alloc)
static constexpr bool SampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits *vkSamples)
@ VK_IMAGE_LAYOUT_PREINITIALIZED
@ VK_IMAGE_LAYOUT_UNDEFINED
@ VK_SHARING_MODE_EXCLUSIVE
@ VK_IMAGE_CREATE_PROTECTED_BIT
@ VK_IMAGE_TILING_OPTIMAL
@ VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
VkFlags VkImageCreateFlags
#define VK_QUEUE_FAMILY_IGNORED
@ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO