Skip to content

Commit

Permalink
igl | vulkan | Fix deprecated PVRTC formats validation errors
Browse files Browse the repository at this point in the history
Summary:
PVRTC formats are deprecated without replacement. This diff fixes some Vulkan validation errors.

> Both PVRTC1 and PVRTC2 are slower than standard image formats on PowerVR GPUs, and support will be removed from future hardware.

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_IMG_format_pvrtc.html

Reviewed By: pixelperfect3

Differential Revision: D49175170

fbshipit-source-id: 0144c4181f3a12c1b8d92db6415e24865e19a1ef
  • Loading branch information
corporateshark authored and facebook-github-bot committed Sep 13, 2023
1 parent 0fc8158 commit 93a8f8b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/igl/vulkan/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,19 @@ ICapabilities::TextureFormatCapabilities Device::getTextureFormatCapabilities(
return TextureFormatCapabilityBits::Unsupported;
}

if (vkFormat == VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG ||
vkFormat == VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG ||
vkFormat == VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG ||
vkFormat == VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG ||
vkFormat == VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG ||
vkFormat == VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG ||
vkFormat == VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG ||
vkFormat == VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG) {
// Deprecated without replacement
// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_IMG_format_pvrtc.html
return TextureFormatCapabilityBits::Unsupported;
}

VkFormatProperties properties;
vkGetPhysicalDeviceFormatProperties(ctx_->vkPhysicalDevice_, vkFormat, &properties);

Expand Down

0 comments on commit 93a8f8b

Please sign in to comment.