From 96dcdbfc51c980c01262c99ac07c50c7e758dc2a Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 2 May 2023 16:20:25 +0200 Subject: [PATCH] Vulkan: Correct Aspectbits for Depth Textures Vulkan spec only wants to have a single aspect bit when a texture contains both a stencil and a depth part. As for Blender depth is more used than stencil we standardize to depth aspect. Pull Request: https://projects.blender.org/blender/blender/pulls/107542 --- source/blender/gpu/vulkan/vk_common.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/blender/gpu/vulkan/vk_common.cc b/source/blender/gpu/vulkan/vk_common.cc index fb20a44d5d7..ede3abf35da 100644 --- a/source/blender/gpu/vulkan/vk_common.cc +++ b/source/blender/gpu/vulkan/vk_common.cc @@ -50,15 +50,13 @@ VkImageAspectFlagBits to_vk_image_aspect_flag_bits(const eGPUTextureFormat forma case GPU_R11F_G11F_B10F: case GPU_SRGB8_A8: return VK_IMAGE_ASPECT_COLOR_BIT; - case GPU_DEPTH32F_STENCIL8: - case GPU_DEPTH24_STENCIL8: - return static_cast(VK_IMAGE_ASPECT_DEPTH_BIT | - VK_IMAGE_ASPECT_STENCIL_BIT); /* Depth Formats. */ case GPU_DEPTH_COMPONENT32F: case GPU_DEPTH_COMPONENT24: case GPU_DEPTH_COMPONENT16: + case GPU_DEPTH32F_STENCIL8: + case GPU_DEPTH24_STENCIL8: return VK_IMAGE_ASPECT_DEPTH_BIT; /* Texture only formats. */