anv: Better types for 'aspect' function params
authorChad Versace <chadversary@chromium.org>
Fri, 3 Nov 2017 00:26:51 +0000 (17:26 -0700)
committerChad Versace <chadversary@chromium.org>
Fri, 10 Nov 2017 00:01:59 +0000 (16:01 -0800)
Some functions have a comment that says "Exactly one bit must be in
'aspect'". So change the type of their 'aspect' parameter from
VkImageAspectFlags to VkImageAspectFlagBits.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_formats.c
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_private.h

index ebc6a8351c6b1ad8bc786c7e3cb950301407b6e5..bd03b248ff99d3dffcbbc89b4a5e34f8a631d20d 100644 (file)
@@ -409,7 +409,7 @@ anv_get_format(VkFormat vk_format)
  */
 struct anv_format_plane
 anv_get_format_plane(const struct gen_device_info *devinfo, VkFormat vk_format,
-                     VkImageAspectFlags aspect, VkImageTiling tiling)
+                     VkImageAspectFlagBits aspect, VkImageTiling tiling)
 {
    const struct anv_format *format = anv_get_format(vk_format);
    struct anv_format_plane plane_format = {
index 73777d86a44ed918722edd0c97ef8a5aeed3db1e..32aa8741ffdfd2989d6b7d3c65ca1077236244d5 100644 (file)
 
 #include "vk_format_info.h"
 
-/**
- * Exactly one bit must be set in \a aspect.
- */
 static isl_surf_usage_flags_t
 choose_isl_surf_usage(VkImageCreateFlags vk_create_flags,
                       VkImageUsageFlags vk_usage,
                       isl_surf_usage_flags_t isl_extra_usage,
-                      VkImageAspectFlags aspect)
+                      VkImageAspectFlagBits aspect)
 {
    isl_surf_usage_flags_t isl_usage = isl_extra_usage;
 
@@ -93,11 +90,8 @@ choose_isl_surf_usage(VkImageCreateFlags vk_create_flags,
    return isl_usage;
 }
 
-/**
- * Exactly one bit must be set in \a aspect.
- */
 static struct anv_surface *
-get_surface(struct anv_image *image, VkImageAspectFlags aspect)
+get_surface(struct anv_image *image, VkImageAspectFlagBits aspect)
 {
    uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
    return &image->planes[plane].surface;
@@ -253,14 +247,12 @@ add_fast_clear_state_buffer(struct anv_image *image,
 /**
  * Initialize the anv_image::*_surface selected by \a aspect. Then update the
  * image's memory requirements (that is, the image's size and alignment).
- *
- * Exactly one bit must be set in \a aspect.
  */
 static VkResult
 make_surface(const struct anv_device *dev,
              struct anv_image *image,
              const struct anv_image_create_info *anv_info,
-             VkImageAspectFlags aspect)
+             VkImageAspectFlagBits aspect)
 {
    const VkImageCreateInfo *vk_info = anv_info->vk_info;
    bool ok UNUSED;
index 1fb3772f1827b8ab33031a97b9976fa422649f65..e17a52a4a70399f10cfc50c44659926851643614 100644 (file)
@@ -2280,7 +2280,7 @@ anv_get_format_planes(VkFormat vk_format)
 
 struct anv_format_plane
 anv_get_format_plane(const struct gen_device_info *devinfo, VkFormat vk_format,
-                     VkImageAspectFlags aspect, VkImageTiling tiling);
+                     VkImageAspectFlagBits aspect, VkImageTiling tiling);
 
 static inline enum isl_format
 anv_get_isl_format(const struct gen_device_info *devinfo, VkFormat vk_format,