diff options
author | Jason Ekstrand <[email protected]> | 2015-06-10 21:04:51 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-06-10 21:04:51 -0700 |
commit | 2a3c29698c43601751e43c0344d8f5ba1f57937d (patch) | |
tree | d582049f403e53688d6a3c895c54ab59fed92ae6 | |
parent | c8b62d109b9c4efc7bd493d220d959a16a456e5c (diff) |
vk/image: Add a bunch of asserts
-rw-r--r-- | src/vulkan/image.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vulkan/image.c b/src/vulkan/image.c index 40d5024a0eb..b385be48917 100644 --- a/src/vulkan/image.c +++ b/src/vulkan/image.c @@ -108,6 +108,13 @@ VkResult anv_image_create( if (image == NULL) return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); + /* XXX: We don't handle any of these */ + anv_assert(pCreateInfo->imageType == VK_IMAGE_TYPE_2D); + anv_assert(pCreateInfo->mipLevels == 1); + anv_assert(pCreateInfo->arraySize == 1); + anv_assert(pCreateInfo->samples == 1); + anv_assert(pCreateInfo->extent.depth == 1); + image->bo = NULL; image->offset = 0; image->type = pCreateInfo->imageType; @@ -204,6 +211,13 @@ anv_image_view_init(struct anv_surface_view *view, anv_format_for_vk_format(pCreateInfo->format); uint32_t tile_mode, format; + /* XXX: We don't handle any of these */ + anv_assert(pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_2D); + anv_assert(pCreateInfo->subresourceRange.baseMipLevel == 0); + anv_assert(pCreateInfo->subresourceRange.mipLevels == 1); + anv_assert(pCreateInfo->subresourceRange.baseArraySlice == 0); + anv_assert(pCreateInfo->subresourceRange.arraySize == 1); + view->bo = image->bo; switch (pCreateInfo->subresourceRange.aspect) { case VK_IMAGE_ASPECT_STENCIL: @@ -316,6 +330,12 @@ anv_color_attachment_view_init(struct anv_surface_view *view, const struct anv_format *format = anv_format_for_vk_format(pCreateInfo->format); + /* XXX: We don't handle any of these */ + anv_assert(pCreateInfo->mipLevel == 0); + anv_assert(pCreateInfo->baseArraySlice == 0); + anv_assert(pCreateInfo->arraySize == 1); + anv_assert(pCreateInfo->msaaResolveImage == 0); + view->bo = image->bo; view->offset = image->offset; view->extent = image->extent; @@ -410,6 +430,12 @@ VkResult anv_CreateDepthStencilView( if (view == NULL) return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); + /* XXX: We don't handle any of these */ + anv_assert(pCreateInfo->mipLevel == 0); + anv_assert(pCreateInfo->baseArraySlice == 0); + anv_assert(pCreateInfo->arraySize == 1); + anv_assert(pCreateInfo->msaaResolveImage == 0); + view->bo = image->bo; view->depth_stride = image->stride; |