vk/0.210.0: Change field names in vertex input structs
[mesa.git] / src / vulkan / anv_image.c
index e90257e8faaf216dc7c4cfdddeaf9ab6aa592fbd..0fe2df10a7a66d5d329b71818c04ee357a478fb4 100644 (file)
 
 #include "anv_private.h"
 
+/* FIXME: We shouldn't be using the actual hardware enum values here.  They
+ * change across gens.  Once we get that fixed, this include needs to go.
+ */
+#include "gen8_pack.h"
+
 static const uint8_t anv_halign[] = {
     [4] = HALIGN4,
     [8] = HALIGN8,
@@ -269,12 +274,12 @@ anv_image_get_full_usage(const VkImageCreateInfo *info)
 {
    VkImageUsageFlags usage = info->usage;
 
-   if (usage & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) {
+   if (usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
       /* Meta will transfer from the image by binding it as a texture. */
       usage |= VK_IMAGE_USAGE_SAMPLED_BIT;
    }
 
-   if (usage & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) {
+   if (usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
       /* Meta will transfer to the image by binding it as a color attachment,
        * even if the image format is not a color format.
        */
@@ -417,7 +422,7 @@ anv_surface_get_subresource_layout(struct anv_image *image,
       layout->size = surface->stride * image->extent.height;
 }
 
-VkResult anv_GetImageSubresourceLayout(
+void anv_GetImageSubresourceLayout(
     VkDevice                                    device,
     VkImage                                     _image,
     const VkImageSubresource*                   pSubresource,
@@ -439,10 +444,8 @@ VkResult anv_GetImageSubresourceLayout(
                                          pSubresource, pLayout);
       break;
    default:
-      return vk_error(VK_UNSUPPORTED);
+      assert(!"Invalid image aspect");
    }
-
-   return VK_SUCCESS;
 }
 
 VkResult
@@ -471,14 +474,14 @@ anv_validate_CreateImageView(VkDevice _device,
    view_format_info = anv_format_for_vk_format(pCreateInfo->format);
 
    /* Validate channel swizzles. */
-   assert(pCreateInfo->channels.r >= VK_CHANNEL_SWIZZLE_BEGIN_RANGE);
-   assert(pCreateInfo->channels.r <= VK_CHANNEL_SWIZZLE_END_RANGE);
-   assert(pCreateInfo->channels.g >= VK_CHANNEL_SWIZZLE_BEGIN_RANGE);
-   assert(pCreateInfo->channels.g <= VK_CHANNEL_SWIZZLE_END_RANGE);
-   assert(pCreateInfo->channels.b >= VK_CHANNEL_SWIZZLE_BEGIN_RANGE);
-   assert(pCreateInfo->channels.b <= VK_CHANNEL_SWIZZLE_END_RANGE);
-   assert(pCreateInfo->channels.a >= VK_CHANNEL_SWIZZLE_BEGIN_RANGE);
-   assert(pCreateInfo->channels.a <= VK_CHANNEL_SWIZZLE_END_RANGE);
+   assert(pCreateInfo->components.r >= VK_COMPONENT_SWIZZLE_BEGIN_RANGE);
+   assert(pCreateInfo->components.r <= VK_COMPONENT_SWIZZLE_END_RANGE);
+   assert(pCreateInfo->components.g >= VK_COMPONENT_SWIZZLE_BEGIN_RANGE);
+   assert(pCreateInfo->components.g <= VK_COMPONENT_SWIZZLE_END_RANGE);
+   assert(pCreateInfo->components.b >= VK_COMPONENT_SWIZZLE_BEGIN_RANGE);
+   assert(pCreateInfo->components.b <= VK_COMPONENT_SWIZZLE_END_RANGE);
+   assert(pCreateInfo->components.a >= VK_COMPONENT_SWIZZLE_BEGIN_RANGE);
+   assert(pCreateInfo->components.a <= VK_COMPONENT_SWIZZLE_END_RANGE);
 
    /* Validate subresource. */
    assert(subresource->aspectMask != 0);
@@ -560,11 +563,17 @@ anv_image_view_init(struct anv_image_view *iview,
 
    switch (device->info.gen) {
    case 7:
-      gen7_image_view_init(iview, device, pCreateInfo, cmd_buffer);
+      if (device->info.is_haswell)
+         gen75_image_view_init(iview, device, pCreateInfo, cmd_buffer);
+      else
+         gen7_image_view_init(iview, device, pCreateInfo, cmd_buffer);
       break;
    case 8:
       gen8_image_view_init(iview, device, pCreateInfo, cmd_buffer);
       break;
+   case 9:
+      gen9_image_view_init(iview, device, pCreateInfo, cmd_buffer);
+      break;
    default:
       unreachable("unsupported gen\n");
    }