21#define SHARED_GR_VULKAN_CALL(IFACE, X) (IFACE)->fFunctions.f##X
61 outInfo->
pNext =
nullptr;
72#ifdef SK_BUILD_FOR_ANDROID
77void GetYcbcrConversionInfoFromFormatProps(
78 VulkanYcbcrConversionInfo* outConversionInfo,
85 outConversionInfo->fForceExplicitReconstruction =
VK_FALSE;
96bool GetAHardwareBufferProperties(
102 outHwbFormatProps->
sType =
104 outHwbFormatProps->
pNext =
nullptr;
107 outHwbProps->
pNext = outHwbFormatProps;
111 GetAndroidHardwareBufferProperties(
device,
115 SkDebugf(
"Failed to get AndroidHardwareBufferProperties\n");
129 uint32_t typeIndex = 0;
130 bool foundHeap =
false;
132 for (uint32_t
i = 0;
i < memTypeCnt && !foundHeap; ++
i) {
162 hwbImportInfo.
pNext =
nullptr;
163 hwbImportInfo.
buffer = hardwareBuffer;
167 dedicatedAllocInfo.
pNext = &hwbImportInfo;
178 VkDeviceMemory memory;
180 AllocateMemory(
device, &allocInfo,
nullptr, &memory));
187 bindImageInfo.
pNext =
nullptr;
189 bindImageInfo.
memory = memory;
198 outVulkanAlloc->
fMemory = memory;
201 outVulkanAlloc->
fFlags = 0;
214 bool supportsDeviceFaultInfoExtension) {
215 if (!deviceLostProc) {
219 std::vector<VkDeviceFaultAddressInfoEXT> addressInfos = {};
220 std::vector<VkDeviceFaultVendorInfoEXT> vendorInfos = {};
221 std::vector<std::byte> vendorBinaryData = {};
223 if (!supportsDeviceFaultInfoExtension) {
224 deviceLostProc(deviceLostContext,
225 "No details: VK_EXT_device_fault not available/enabled.",
236 GetDeviceFaultInfo(vkDevice, &faultCounts, NULL));
260 GetDeviceFaultInfo(vkDevice, &faultCounts, &faultInfo));
271 deviceLostProc(deviceLostContext,
struct AHardwareBuffer AHardwareBuffer
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define SHARED_GR_VULKAN_CALL(IFACE, X)
sk_sp< const SkImage > image
void * VulkanDeviceLostContext
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 SkString to_string(int n)
VkDeviceSize allocationSize
VkDeviceSize memoryOffset
VkDeviceSize vendorBinarySize
uint32_t addressInfoCount
char description[VK_MAX_DESCRIPTION_SIZE]
VkDeviceFaultAddressInfoEXT * pAddressInfos
VkDeviceFaultVendorInfoEXT * pVendorInfos
struct AHardwareBuffer * buffer
VkMemoryPropertyFlags propertyFlags
VkPhysicalDeviceMemoryProperties memoryProperties
VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]
VkChromaLocation xChromaOffset
VkComponentMapping components
VkSamplerYcbcrRange ycbcrRange
VkBool32 forceExplicitReconstruction
VkSamplerYcbcrModelConversion ycbcrModel
VkChromaLocation yChromaOffset
VulkanBackendMemory fBackendMemory
VkSamplerYcbcrRange fYcbcrRange
VkSamplerYcbcrModelConversion fYcbcrModel
VkComponentMapping fComponents
VkBool32 fForceExplicitReconstruction
VkChromaLocation fYChromaOffset
VkChromaLocation fXChromaOffset
VkFormatFeatureFlags fFormatFeatures
@ VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
@ VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT
@ VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT
@ VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT
@ VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT
@ VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT
@ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
@ VK_CHROMA_LOCATION_COSITED_EVEN
@ VK_CHROMA_LOCATION_MIDPOINT
VkFlags VkFormatFeatureFlags
@ VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID
@ VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT
@ VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID
@ VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT
@ VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO
@ VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO
@ VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID
@ VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO
@ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO