Protected content fix vulkan 2 (#9721)

* Adding the begin frame message for later xtrace post processing.

* Add the flags.

* Cleanup

* Cleanup

---------

Co-authored-by: Powei Feng <powei@google.com>
This commit is contained in:
Serge Metral
2026-02-18 09:50:17 -08:00
committed by GitHub
co-authored by Powei Feng
parent 1deb657442
commit 14960f7118
2 changed files with 7 additions and 1 deletions
@@ -368,6 +368,7 @@ VulkanTexture::VulkanTexture(VkDevice device, VkPhysicalDevice physicalDevice,
bool const isProtected = any(tusage & TextureUsage::PROTECTED);
VkImageCreateInfo imageInfo{
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
.flags = isProtected ? VK_IMAGE_CREATE_PROTECTED_BIT : 0u,
.imageType = target == SamplerType::SAMPLER_3D ? VK_IMAGE_TYPE_3D : VK_IMAGE_TYPE_2D,
.format = vkFormat,
.extent = {w, h, depth},
@@ -378,10 +378,15 @@ VulkanPlatform::ImageData VulkanPlatformAndroid::createVkImageFromExternal(
externalCreateInfo.pNext = &imageFormatListInfo;
}
VkImageCreateFlags imageFlags =
(isFormatSrgb(metadata.format) ? VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT : 0u) |
(any(metadata.filamentUsage & TextureUsage::PROTECTED)
? VK_IMAGE_CREATE_PROTECTED_BIT
: 0u);
VkImageCreateInfo const imageInfo = {
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
.pNext = &externalCreateInfo,
.flags = isFormatSrgb(metadata.format) ? VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT : 0u,
.flags = imageFlags,
.imageType = VK_IMAGE_TYPE_2D,
// For non external images, use the same format as the AHB, which isn't in SRGB
// Fix VUID-VkMemoryAllocateInfo-pNext-02387