8#ifndef skgpu_graphite_VulkanGraphiteUtilsPriv_DEFINED
9#define skgpu_graphite_VulkanGraphiteUtilsPriv_DEFINED
22#define VULKAN_CALL(IFACE, X) (IFACE)->fFunctions.f##X
26#define VULKAN_LOG_IF_NOT_SUCCESS(SHARED_CONTEXT, RESULT, X, ...) \
28 if (RESULT != VK_SUCCESS && !(SHARED_CONTEXT)->isDeviceLost()) { \
29 SkDebugf("Failed vulkan call. Error: %d, " X "\n", RESULT, ##__VA_ARGS__); \
33#define VULKAN_CALL_RESULT(SHARED_CONTEXT, RESULT, X) \
35 (RESULT) = VULKAN_CALL((SHARED_CONTEXT)->interface(), X); \
36 SkASSERT(VK_SUCCESS == RESULT || VK_ERROR_DEVICE_LOST == RESULT); \
37 VULKAN_LOG_IF_NOT_SUCCESS(SHARED_CONTEXT, RESULT, #X); \
38 (SHARED_CONTEXT)->checkVkResult(RESULT); \
42#define VULKAN_CALL_ERRCHECK(SHARED_CONTEXT, X) \
43 VkResult SK_MACRO_APPEND_LINE(ret); \
44 VULKAN_CALL_RESULT(SHARED_CONTEXT, SK_MACRO_APPEND_LINE(ret), X)
46#define VULKAN_CALL_RESULT_NOCHECK(IFACE, RESULT, X) \
48 (RESULT) = VULKAN_CALL(IFACE, X); \
52class VulkanSharedContext;
55 const std::string& spirv,
61 VkDescriptorSetLayout*);
63namespace ycbcrPackaging {
static constexpr int kInt32sNeededKnownFormat
static constexpr uint32_t kYChromaOffsetMask
static constexpr int kInt32sNeededExternalFormat
static constexpr uint32_t kComponentAMask
static constexpr uint32_t kYcbcrRangeMask
static constexpr int kComponentBits
static constexpr int kYcbcrRangeBits
static constexpr int kUsesExternalFormatBits
static constexpr int kComponentBShift
static constexpr int kChromaFilterShift
static constexpr uint32_t kComponentGMask
static constexpr uint32_t kXChromaOffsetMask
static constexpr int kYChromaOffsetShift
static constexpr int kYChromaOffsetBits
int numInt32sNeeded(const VulkanYcbcrConversionInfo &conversionInfo)
static constexpr int kComponentAShift
static constexpr uint32_t kUseExternalFormatMask
static constexpr uint32_t kYcbcrModelMask
static constexpr int kYcbcrRangeShift
static constexpr int kUsesExternalFormatShift
static constexpr int kComponentRShift
static constexpr int kComponentGShift
static constexpr int kForceExplicitReconShift
static constexpr int kForceExplicitReconBits
static constexpr uint32_t kChromaFilterMask
static constexpr int kXChromaOffsetBits
static constexpr int kXChromaOffsetShift
uint32_t nonFormatInfoAsUInt32(const VulkanYcbcrConversionInfo &conversionInfo)
static constexpr uint32_t kForceExplicitReconMask
static constexpr int kYcbcrModelBits
static constexpr uint32_t kComponentRMask
static constexpr int kChromaFilterBits
static constexpr uint32_t kComponentBMask
static constexpr int kYcbcrModelShift
VkShaderModule createVulkanShaderModule(const VulkanSharedContext *context, const std::string &spirv, VkShaderStageFlagBits stage)
VkDescriptorType DsTypeEnumToVkDs(DescriptorType type)
bool vkFormatIsSupported(VkFormat format)
void DescriptorDataToVkDescSetLayout(const VulkanSharedContext *ctxt, const SkSpan< DescriptorData > &requestedDescriptors, VkDescriptorSetLayout *outLayout)
VkShaderStageFlags PipelineStageFlagsToVkShaderStageFlags(SkEnumBitMask< PipelineStageFlags > stageFlags)
VkFlags VkShaderStageFlags