From c960731c28c9a4f8f83327f586b745e72474dab8 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Thu, 15 Oct 2020 19:29:26 +0800 Subject: [PATCH] add hasColor/hasDepth.... functions at ImageView --- inc/hgl/graph/vulkan/VKImageView.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/hgl/graph/vulkan/VKImageView.h b/inc/hgl/graph/vulkan/VKImageView.h index ac8061b8..bed94cf0 100644 --- a/inc/hgl/graph/vulkan/VKImageView.h +++ b/inc/hgl/graph/vulkan/VKImageView.h @@ -42,6 +42,11 @@ public: const VkFormat GetFormat ()const{return format;} const VkExtent3D & GetExtent ()const{return extent;} const VkImageAspectFlags GetAspectFlags ()const{return aspect_mask;} + + const bool hasColor ()const{return aspect_mask&VK_IMAGE_ASPECT_COLOR_BIT;} + const bool hasDepth ()const{return aspect_mask&VK_IMAGE_ASPECT_DEPTH_BIT;} + const bool hasStencil ()const{return aspect_mask&VK_IMAGE_ASPECT_STENCIL_BIT;} + const bool hasDepthStencil ()const{return aspect_mask&(VK_IMAGE_ASPECT_DEPTH_BIT|VK_IMAGE_ASPECT_STENCIL_BIT);} };//class ImageView ImageView *CreateImageView(VkDevice device,VkImageViewType type,VkFormat format,const VkExtent3D &ext,VkImageAspectFlags aspectMask,VkImage img);