-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vk: Fix unsupported depth blitting #7789
Conversation
On certain hardware (pixel 4 for example), blitting of depth texture is not supported as an "optimalTilingFeature". In these cases, we'd would need to do a shader-based blit. We - Add the shader blit in PostProcessingManager - Add a driver API to check for support for blitting depthStencil attachments. - Fix some debugging ifdefs in vk backend. The validation fixed is: `[ VUID-vkCmdBlitImage-dstImage-02000 ] Object 0: handle = 0xb400007c300701d0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xf2039b0000000771, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x86bc2a78 | In vkCmdBlitImage, VkFormatFeatureFlags (0x1c601) does not support required feature VK_FORMAT_FEATURE_2_BLIT_DST_BIT for format 126 used by VkImage 0xf2039b0000000771[] with tiling VK_IMAGE_TILING_OPTIMAL. The Vulkan spec states: The format features of dstImage must contain VK_FORMAT_FEATURE_BLIT_DST_BIT`
@@ -303,6 +303,7 @@ DECL_DRIVER_API_SYNCHRONOUS_0(bool, isProtectedContentSupported) | |||
DECL_DRIVER_API_SYNCHRONOUS_N(bool, isStereoSupported, backend::StereoscopicType, stereoscopicType) | |||
DECL_DRIVER_API_SYNCHRONOUS_0(bool, isParallelShaderCompileSupported) | |||
DECL_DRIVER_API_SYNCHRONOUS_0(bool, isDepthStencilResolveSupported) | |||
DECL_DRIVER_API_SYNCHRONOUS_N(bool, isDepthStencilBlitSupported, backend::TextureFormat, format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so depth blitting support is not all or nothing? it depends on the specific format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice, it's probably all or nothing.
But in Vulkan, for the general use case of "can you do x with texture", it's a check against the format of the texture.
d283fbe
to
c9ed363
Compare
} | ||
} | ||
format = (VkFormat) (1 + (int) format); | ||
if (format == VK_FORMAT_ASTC_12x12_SRGB_BLOCK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe comment that this is the last format provided by VK_VERSION_1_0? And do we want to exclude VK_FORMAT_ASTC_12x12_SRGB_BLOCK
from this check (maybe this if needs to be before line 539)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, this could definitely be cleaner. I'll put up a follow-up to clean this up.
On certain hardware (pixel 4 for example), blitting of depth texture is not supported as an "optimalTilingFeature". In these cases, we'd would need to do a shader-based blit. We
The validation fixed is:
[ VUID-vkCmdBlitImage-dstImage-02000 ] Object 0: handle = 0xb400007c300701d0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xf2039b0000000771, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x86bc2a78 | In vkCmdBlitImage, VkFormatFeatureFlags (0x1c601) does not support required feature VK_FORMAT_FEATURE_2_BLIT_DST_BIT for format 126 used by VkImage 0xf2039b0000000771[] with tiling VK_IMAGE_TILING_OPTIMAL. The Vulkan spec states: The format features of dstImage must contain VK_FORMAT_FEATURE_BLIT_DST_BIT