summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-05-13 12:50:11 -0700
committerJason Ekstrand <[email protected]>2016-05-17 12:17:22 -0700
commit234ecf26c65a8909e91313a8b35e2a8a8bbfc0ef (patch)
tree95ec965887390be3537d0a74adff7f99a8df573c /src/intel/vulkan/anv_image.c
parent1bda8d06e54ee56db89a00e7a9ed8577d724fc9f (diff)
anv/image: Add an aspects field
This makes several checks easier and allows us to avoid calling anv_format_for_vk_format in a number of cases.
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r--src/intel/vulkan/anv_image.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index fb2838924dd..6316a2aadc5 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -233,12 +233,14 @@ anv_image_create(VkDevice _device,
image->tiling = pCreateInfo->tiling;
if (likely(anv_format_is_color(format))) {
+ image->aspects |= VK_IMAGE_ASPECT_COLOR_BIT;
r = make_surface(device, image, create_info,
VK_IMAGE_ASPECT_COLOR_BIT);
if (r != VK_SUCCESS)
goto fail;
} else {
if (image->format->has_depth) {
+ image->aspects |= VK_IMAGE_ASPECT_DEPTH_BIT;
r = make_surface(device, image, create_info,
VK_IMAGE_ASPECT_DEPTH_BIT);
if (r != VK_SUCCESS)
@@ -246,6 +248,7 @@ anv_image_create(VkDevice _device,
}
if (image->format->has_stencil) {
+ image->aspects |= VK_IMAGE_ASPECT_STENCIL_BIT;
r = make_surface(device, image, create_info,
VK_IMAGE_ASPECT_STENCIL_BIT);
if (r != VK_SUCCESS)