anv/image: Drop assertions on SURFTYPE extent limits
authorChad Versace <chad.versace@intel.com>
Thu, 3 Dec 2015 02:27:35 +0000 (18:27 -0800)
committerChad Versace <chad.versace@intel.com>
Thu, 3 Dec 2015 23:29:52 +0000 (15:29 -0800)
In anv_image_create(), stop asserting that VkImageCreateInfo::extent
does not exceed the hardware limits for the given SURFTYPE. The
assertions were incorrect because they did not take into account the
hardware gen. Anyways, these types of assertions belong in isl, not
anvil.

src/vulkan/anv_image.c

index 2bfe19f36095298e1cf1455dc9e9a3c912bbd487..69103209022bc8e6707eae41a47eeb6bda2fbd79 100644 (file)
@@ -71,19 +71,6 @@ anv_image_view_info_for_vk_image_view_type(VkImageViewType type)
    return anv_image_view_info_table[type];
 }
 
-static const struct anv_surf_type_limits {
-   int32_t width;
-   int32_t height;
-   int32_t depth;
-} anv_surf_type_limits[] = {
-   [SURFTYPE_1D]     = {16384,       1,   2048},
-   [SURFTYPE_2D]     = {16384,   16384,   2048},
-   [SURFTYPE_3D]     = {2048,     2048,   2048},
-   [SURFTYPE_CUBE]   = {16384,   16384,    340},
-   [SURFTYPE_BUFFER] = {128,     16384,     64},
-   [SURFTYPE_STRBUF] = {128,     16384,     64},
-};
-
 static isl_tiling_flags_t
 choose_isl_tiling_flags(const struct anv_image_create_info *anv_info)
 {
@@ -228,7 +215,6 @@ anv_image_create(VkDevice _device,
 {
    ANV_FROM_HANDLE(anv_device, device, _device);
    const VkImageCreateInfo *pCreateInfo = create_info->vk_info;
-   const VkExtent3D *restrict extent = &pCreateInfo->extent;
    struct anv_image *image = NULL;
    VkResult r;
 
@@ -245,14 +231,6 @@ anv_image_create(VkDevice _device,
    const uint8_t surf_type =
       anv_surf_type_from_image_type[pCreateInfo->imageType];
 
-   const struct anv_surf_type_limits *limits =
-      &anv_surf_type_limits[surf_type];
-
-   /* Errors should be caught by VkImageFormatProperties. */
-   assert(extent->width <= limits->width);
-   assert(extent->height <= limits->height);
-   assert(extent->depth <= limits->depth);
-
    image = anv_alloc2(&device->alloc, alloc, sizeof(*image), 8,
                       VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (!image)