Lines Matching refs:infoPtr
1958 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle); in initializeVkColorBufferLocked() local
1960 if (!infoPtr) { in initializeVkColorBufferLocked()
1964 if (infoPtr->initialized) { in initializeVkColorBufferLocked()
1968 if (!isFormatVulkanCompatible(infoPtr->internalFormat)) { in initializeVkColorBufferLocked()
1970 infoPtr->internalFormat); in initializeVkColorBufferLocked()
1983 bool glCompatible = (infoPtr->frameworkFormat == FRAMEWORK_FORMAT_GL_COMPATIBLE); in initializeVkColorBufferLocked()
1984 switch (infoPtr->frameworkFormat) { in initializeVkColorBufferLocked()
1986 vkFormat = glFormat2VkFormat(infoPtr->internalFormat); in initializeVkColorBufferLocked()
1999 VK_COMMON_ERROR("WARNING: unhandled framework format %d\n", infoPtr->frameworkFormat); in initializeVkColorBufferLocked()
2000 vkFormat = glFormat2VkFormat(infoPtr->internalFormat); in initializeVkColorBufferLocked()
2004 VkImageTiling tiling = (infoPtr->memoryProperty & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) in initializeVkColorBufferLocked()
2008 vkFormat, infoPtr->width, infoPtr->height, tiling); in initializeVkColorBufferLocked()
2037 vk->vkCreateImage(sVkEmulation->device, imageCi.get(), nullptr, &infoPtr->image); in initializeVkColorBufferLocked()
2045 infoPtr->imageCreateInfoShallow = vk_make_orphan_copy(*imageCi); in initializeVkColorBufferLocked()
2046 infoPtr->currentQueueFamilyIndex = sVkEmulation->queueFamilyIndex; in initializeVkColorBufferLocked()
2054 nullptr, infoPtr->image}; in initializeVkColorBufferLocked()
2057 infoPtr->memReqs = reqs.memoryRequirements; in initializeVkColorBufferLocked()
2059 vk->vkGetImageMemoryRequirements(sVkEmulation->device, infoPtr->image, &infoPtr->memReqs); in initializeVkColorBufferLocked()
2065 infoPtr->memoryProperty = infoPtr->memoryProperty & (VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | in initializeVkColorBufferLocked()
2068 infoPtr->memory.size = infoPtr->memReqs.size; in initializeVkColorBufferLocked()
2071 if (infoPtr->memoryProperty) { in initializeVkColorBufferLocked()
2072 infoPtr->memory.typeIndex = lastGoodTypeIndexWithMemoryProperties( in initializeVkColorBufferLocked()
2073 infoPtr->memReqs.memoryTypeBits, infoPtr->memoryProperty); in initializeVkColorBufferLocked()
2075 infoPtr->memory.typeIndex = lastGoodTypeIndex(infoPtr->memReqs.memoryTypeBits); in initializeVkColorBufferLocked()
2083 infoPtr->memory.size, infoPtr->memory.typeIndex, in initializeVkColorBufferLocked()
2084 … sVkEmulation->deviceInfo.memProps.memoryTypes[infoPtr->memory.typeIndex].propertyFlags, in initializeVkColorBufferLocked()
2085 infoPtr->memoryProperty); in initializeVkColorBufferLocked()
2087 Optional<VkImage> dedicatedImage = useDedicated ? Optional<VkImage>(infoPtr->image) : kNullopt; in initializeVkColorBufferLocked()
2089 if (!updateExternalMemoryInfo(extMemHandle, &infoPtr->memReqs, &infoPtr->memory)) { in initializeVkColorBufferLocked()
2096 if (!importExternalMemoryDedicatedImage(vk, sVkEmulation->device, &infoPtr->memory, in initializeVkColorBufferLocked()
2097 *dedicatedImage, &infoPtr->memory.memory)) { in initializeVkColorBufferLocked()
2103 } else if (!importExternalMemory(vk, sVkEmulation->device, &infoPtr->memory, in initializeVkColorBufferLocked()
2104 &infoPtr->memory.memory)) { in initializeVkColorBufferLocked()
2110 infoPtr->externalMemoryCompatible = true; in initializeVkColorBufferLocked()
2112 bool isHostVisible = infoPtr->memoryProperty & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; in initializeVkColorBufferLocked()
2114 isHostVisible ? Optional<uint64_t>(infoPtr->memReqs.alignment) : kNullopt; in initializeVkColorBufferLocked()
2115 bool allocRes = allocExternalMemory(vk, &infoPtr->memory, true /*actuallyExternal*/, in initializeVkColorBufferLocked()
2122 infoPtr->externalMemoryCompatible = sVkEmulation->deviceInfo.supportsExternalMemoryExport; in initializeVkColorBufferLocked()
2125 infoPtr->memory.pageOffset = reinterpret_cast<uint64_t>(infoPtr->memory.mappedPtr) % kPageSize; in initializeVkColorBufferLocked()
2126 infoPtr->memory.bindOffset = in initializeVkColorBufferLocked()
2127 infoPtr->memory.pageOffset ? kPageSize - infoPtr->memory.pageOffset : 0u; in initializeVkColorBufferLocked()
2130 sVkEmulation->device, infoPtr->image, infoPtr->memory.memory, infoPtr->memory.bindOffset); in initializeVkColorBufferLocked()
2141 .image = infoPtr->image, in initializeVkColorBufferLocked()
2143 .format = infoPtr->imageCreateInfoShallow.format, in initializeVkColorBufferLocked()
2161 vk->vkCreateImageView(sVkEmulation->device, &imageViewCi, nullptr, &infoPtr->imageView); in initializeVkColorBufferLocked()
2169 sVkEmulation->getMTLTextureFunc(infoPtr->image, &infoPtr->mtlTexture); in initializeVkColorBufferLocked()
2170 if (!infoPtr->mtlTexture) { in initializeVkColorBufferLocked()
2171 VK_COMMON_ERROR("Failed to get MTLTexture for Vulkan image %p.", infoPtr->image); in initializeVkColorBufferLocked()
2174 CFRetain(infoPtr->mtlTexture); in initializeVkColorBufferLocked()
2178 sVkEmulation->debugUtilsHelper.addDebugLabel(infoPtr->image, "ColorBuffer:%d", in initializeVkColorBufferLocked()
2180 sVkEmulation->debugUtilsHelper.addDebugLabel(infoPtr->imageView, "ColorBuffer:%d", in initializeVkColorBufferLocked()
2182 sVkEmulation->debugUtilsHelper.addDebugLabel(infoPtr->memory.memory, "ColorBuffer:%d", in initializeVkColorBufferLocked()
2185 infoPtr->initialized = true; in initializeVkColorBufferLocked()
2193 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle); in createVkColorBufferLocked() local
2195 if (infoPtr) { in createVkColorBufferLocked()
2286 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle); in teardownVkColorBufferLocked() local
2288 if (!infoPtr) return false; in teardownVkColorBufferLocked()
2290 if (infoPtr->initialized) { in teardownVkColorBufferLocked()
2291 auto& info = *infoPtr; in teardownVkColorBufferLocked()
2339 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle); in getColorBufferInfo() local
2341 if (!infoPtr) return res; in getColorBufferInfo()
2343 res = *infoPtr; in getColorBufferInfo()
2813 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBuffer); in getColorBufferExtMemoryHandle() local
2815 if (!infoPtr) { in getColorBufferExtMemoryHandle()
2820 return infoPtr->memory.externalHandle; in getColorBufferExtMemoryHandle()
2828 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBuffer); in setColorBufferVulkanMode() local
2830 if (!infoPtr) { in setColorBufferVulkanMode()
2834 infoPtr->vulkanMode = static_cast<VkEmulation::VulkanMode>(vulkanMode); in setColorBufferVulkanMode()
2844 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBuffer); in getColorBufferMTLTexture() local
2846 if (!infoPtr) { in getColorBufferMTLTexture()
2852 CFRetain(infoPtr->mtlTexture); in getColorBufferMTLTexture()
2854 return infoPtr->mtlTexture; in getColorBufferMTLTexture()
2949 auto infoPtr = android::base::find(sVkEmulation->buffers, bufferHandle); in setupVkBuffer() local
2952 if (infoPtr) { in setupVkBuffer()
3088 auto infoPtr = android::base::find(sVkEmulation->buffers, bufferHandle); in teardownVkBuffer() local
3089 if (!infoPtr) return false; in teardownVkBuffer()
3094 auto& info = *infoPtr; in teardownVkBuffer()
3108 auto infoPtr = android::base::find(sVkEmulation->buffers, bufferHandle); in getBufferExtMemoryHandle() local
3109 if (!infoPtr) { in getBufferExtMemoryHandle()
3114 return infoPtr->memory.externalHandle; in getBufferExtMemoryHandle()
3375 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle); in setColorBufferCurrentLayout() local
3376 if (!infoPtr) { in setColorBufferCurrentLayout()
3380 infoPtr->currentLayout = layout; in setColorBufferCurrentLayout()
3386 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle); in getColorBufferCurrentLayout() local
3387 if (!infoPtr) { in getColorBufferCurrentLayout()
3391 return infoPtr->currentLayout; in getColorBufferCurrentLayout()
3457 auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle); in releaseColorBufferForGuestUse() local
3458 if (!infoPtr) { in releaseColorBufferForGuestUse()
3465 if (infoPtr->currentLayout != kGuestUseDefaultImageLayout) { in releaseColorBufferForGuestUse()
3471 .oldLayout = infoPtr->currentLayout, in releaseColorBufferForGuestUse()
3475 .image = infoPtr->image, in releaseColorBufferForGuestUse()
3485 infoPtr->currentLayout = kGuestUseDefaultImageLayout; in releaseColorBufferForGuestUse()
3489 if (infoPtr->currentQueueFamilyIndex != VK_QUEUE_FAMILY_EXTERNAL) { in releaseColorBufferForGuestUse()
3495 .oldLayout = infoPtr->currentLayout, in releaseColorBufferForGuestUse()
3496 .newLayout = infoPtr->currentLayout, in releaseColorBufferForGuestUse()
3497 .srcQueueFamilyIndex = infoPtr->currentQueueFamilyIndex, in releaseColorBufferForGuestUse()
3499 .image = infoPtr->image, in releaseColorBufferForGuestUse()
3509 infoPtr->currentQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL; in releaseColorBufferForGuestUse()