8#ifndef skgpu_VulkanUtilsPriv_DEFINED
9#define skgpu_VulkanUtilsPriv_DEFINED
19#ifdef SK_BUILD_FOR_ANDROID
30struct ProgramInterface;
31struct ProgramSettings;
38class ShaderErrorHandler;
39struct VulkanInterface;
42 const std::string& sksl,
221 struct CommonVulkanHeader {
226 void* pNext = features.
pNext;
228 CommonVulkanHeader*
header =
static_cast<CommonVulkanHeader*
>(pNext);
230 return static_cast<T*
>(pNext);
241 const VulkanYcbcrConversionInfo& conversionInfo);
273 default:
return "Unknown";
277#ifdef SK_BUILD_FOR_ANDROID
281void GetYcbcrConversionInfoFromFormatProps(
282 VulkanYcbcrConversionInfo* outConversionInfo,
285bool GetAHardwareBufferProperties(
311 bool supportsDeviceFaultInfoExtension);
struct AHardwareBuffer AHardwareBuffer
@ kRGB_SkColorChannelFlags
@ kRGBA_SkColorChannelFlags
@ kRed_SkColorChannelFlag
@ kRG_SkColorChannelFlags
uint32_t uint32_t * format
bool ToSPIRV(Program &program, const ShaderCaps *caps, OutputStream &out)
static constexpr const char * VkFormatToStr(VkFormat vkFormat)
static constexpr int VkFormatStencilBits(VkFormat format)
static constexpr size_t VkFormatBytesPerBlock(VkFormat vkFormat)
static constexpr int VkFormatIsDepth(VkFormat format)
static constexpr int VkFormatIsStencil(VkFormat format)
static constexpr uint32_t VkFormatChannels(VkFormat vkFormat)
static constexpr bool VkFormatNeedsYcbcrSampler(VkFormat format)
bool SkSLToBackend(const SkSL::ShaderCaps *caps, bool(*toBackend)(SkSL::Program &, const SkSL::ShaderCaps *, std::string *), const char *backendLabel, const std::string &sksl, SkSL::ProgramKind programKind, const SkSL::ProgramSettings &settings, std::string *output, SkSL::ProgramInterface *outInterface, ShaderErrorHandler *errorHandler)
static constexpr bool VkFormatIsCompressed(VkFormat vkFormat)
static constexpr SkTextureCompressionType VkFormatToCompressionType(VkFormat vkFormat)
static constexpr bool SampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits *vkSamples)
void * VulkanDeviceLostContext
bool SkSLToSPIRV(const SkSL::ShaderCaps *caps, const std::string &sksl, SkSL::ProgramKind programKind, const SkSL::ProgramSettings &settings, std::string *spirv, SkSL::ProgramInterface *outInterface, ShaderErrorHandler *errorHandler)
T * GetExtensionFeatureStruct(const VkPhysicalDeviceFeatures2 &features, VkStructureType type)
void(* VulkanDeviceLostProc)(VulkanDeviceLostContext faultContext, const std::string &description, const std::vector< VkDeviceFaultAddressInfoEXT > &addressInfos, const std::vector< VkDeviceFaultVendorInfoEXT > &vendorInfos, const std::vector< std::byte > &vendorBinaryData)
void SetupSamplerYcbcrConversionInfo(VkSamplerYcbcrConversionCreateInfo *outInfo, const VulkanYcbcrConversionInfo &conversionInfo)
void InvokeDeviceLostCallback(const skgpu::VulkanInterface *vulkanInterface, VkDevice vkDevice, skgpu::VulkanDeviceLostContext deviceLostContext, skgpu::VulkanDeviceLostProc deviceLostProc, bool supportsDeviceFaultInfoExtension)
static const char header[]
@ VK_FORMAT_R16G16B16A16_UNORM
@ VK_FORMAT_R8G8B8A8_SRGB
@ VK_FORMAT_D24_UNORM_S8_UINT
@ VK_FORMAT_B8G8R8A8_UNORM
@ VK_FORMAT_R16G16_SFLOAT
@ VK_FORMAT_B4G4R4A4_UNORM_PACK16
@ VK_FORMAT_R32G32B32A32_SFLOAT
@ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16
@ VK_FORMAT_R5G6B5_UNORM_PACK16
@ VK_FORMAT_R4G4B4A4_UNORM_PACK16
@ VK_FORMAT_A2B10G10R10_UNORM_PACK32
@ VK_FORMAT_R8G8B8A8_UNORM
@ VK_FORMAT_BC1_RGB_UNORM_BLOCK
@ VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM
@ VK_FORMAT_R16G16B16A16_SFLOAT
@ VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK
@ VK_FORMAT_A2R10G10B10_UNORM_PACK32
@ VK_FORMAT_BC1_RGBA_UNORM_BLOCK
@ VK_FORMAT_G8_B8R8_2PLANE_420_UNORM
@ VK_FORMAT_B5G6R5_UNORM_PACK16
@ VK_FORMAT_D32_SFLOAT_S8_UINT