vk/0.210.0: Get rid of VkImageAspect
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Dec 2015 20:19:11 +0000 (12:19 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 3 Dec 2015 21:43:53 +0000 (13:43 -0800)
include/vulkan/vulkan.h
src/vulkan/anv_dump.c
src/vulkan/anv_image.c

index 0a28ade4a25a485cd48fa44c391ebb78a250d1f0..cae02065ad1e3ad7aa662a28a1c8c6196d50a7e7 100644 (file)
@@ -409,17 +409,6 @@ typedef enum VkPhysicalDeviceType {
     VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF
 } VkPhysicalDeviceType;
 
-typedef enum {
-    VK_IMAGE_ASPECT_COLOR = 0,
-    VK_IMAGE_ASPECT_DEPTH = 1,
-    VK_IMAGE_ASPECT_STENCIL = 2,
-    VK_IMAGE_ASPECT_METADATA = 3,
-    VK_IMAGE_ASPECT_BEGIN_RANGE = VK_IMAGE_ASPECT_COLOR,
-    VK_IMAGE_ASPECT_END_RANGE = VK_IMAGE_ASPECT_METADATA,
-    VK_IMAGE_ASPECT_NUM = (VK_IMAGE_ASPECT_METADATA - VK_IMAGE_ASPECT_COLOR + 1),
-    VK_IMAGE_ASPECT_MAX_ENUM = 0x7FFFFFFF
-} VkImageAspect;
-
 typedef enum VkQueryType {
     VK_QUERY_TYPE_OCCLUSION = 0,
     VK_QUERY_TYPE_PIPELINE_STATISTICS = 1,
@@ -1420,7 +1409,7 @@ typedef struct VkSparseImageOpaqueMemoryBindInfo {
 } VkSparseImageOpaqueMemoryBindInfo;
 
 typedef struct VkImageSubresource {
-    VkImageAspect                               aspect;
+    VkImageAspectFlags                          aspectMask;
     uint32_t                                    mipLevel;
     uint32_t                                    arrayLayer;
 } VkImageSubresource;
index b2d0b385d0a3db0caf02c6047f14973e71da907b..b232f6b206bdb020ad9c96b35f659b3dd1880b83 100644 (file)
@@ -178,7 +178,7 @@ anv_dump_image_to_ppm(struct anv_device *device,
    VkSubresourceLayout layout;
    anv_GetImageSubresourceLayout(vk_device, copy_image,
       &(VkImageSubresource) {
-         .aspect = VK_IMAGE_ASPECT_COLOR,
+         .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
          .mipLevel = 0,
          .arrayLayer = 0,
       }, &layout);
index 0fe2df10a7a66d5d329b71818c04ee357a478fb4..6c39b355958a4464ff149a4a1c8dfdc2e2cad71d 100644 (file)
@@ -430,16 +430,18 @@ void anv_GetImageSubresourceLayout(
 {
    ANV_FROM_HANDLE(anv_image, image, _image);
 
-   switch (pSubresource->aspect) {
-   case VK_IMAGE_ASPECT_COLOR:
+   assert(__builtin_popcount(pSubresource->aspectMask) == 1);
+
+   switch (pSubresource->aspectMask) {
+   case VK_IMAGE_ASPECT_COLOR_BIT:
       anv_surface_get_subresource_layout(image, &image->color_surface,
                                          pSubresource, pLayout);
       break;
-   case VK_IMAGE_ASPECT_DEPTH:
+   case VK_IMAGE_ASPECT_DEPTH_BIT:
       anv_surface_get_subresource_layout(image, &image->depth_surface,
                                          pSubresource, pLayout);
       break;
-   case VK_IMAGE_ASPECT_STENCIL:
+   case VK_IMAGE_ASPECT_STENCIL_BIT:
       anv_surface_get_subresource_layout(image, &image->stencil_surface,
                                          pSubresource, pLayout);
       break;
@@ -520,7 +522,7 @@ anv_validate_CreateImageView(VkDevice _device,
                 image->format->isl_layout->bs);
       }
 
-      if (subresource->aspectMask & VK_IMAGE_ASPECT_STENCIL) {
+      if (subresource->aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT) {
          /* FINISHME: Is it legal to have an R8 view of S8? */
          assert(image->format->has_stencil);
          assert(view_format_info->has_stencil);