diff options
author | Chad Versace <[email protected]> | 2015-09-14 14:37:09 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2015-09-14 15:15:12 -0700 |
commit | 622a317e4c6163190508fecec82111520a84015e (patch) | |
tree | adb7665b914aa75f489246259e8f7a73b5653562 /src/vulkan/anv_image.c | |
parent | 6221593ff81a19129eee53a1cbded0d009425a38 (diff) |
vk/image: Teach vkCreateImage about layout of 1D surfaces
Calling vkCreateImage() with VK_IMAGE_TYPE_1D now succeeds and computes
the surface layout correctly.
Diffstat (limited to 'src/vulkan/anv_image.c')
-rw-r--r-- | src/vulkan/anv_image.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c index f0577a50a94..dce4208ed5f 100644 --- a/src/vulkan/anv_image.c +++ b/src/vulkan/anv_image.c @@ -72,7 +72,7 @@ static const struct anv_surf_type_limits { int32_t height; int32_t depth; } anv_surf_type_limits[] = { - [SURFTYPE_1D] = {16384, 0, 2048}, + [SURFTYPE_1D] = {16384, 1, 2048}, [SURFTYPE_2D] = {16384, 16384, 2048}, [SURFTYPE_3D] = {2048, 2048, 2048}, [SURFTYPE_CUBE] = {16384, 16384, 340}, @@ -171,8 +171,13 @@ anv_image_make_surface(const struct anv_image_create_info *create_info, switch (create_info->vk_info->imageType) { case VK_IMAGE_TYPE_1D: - anv_finishme("VK_IMAGE_TYPE_1D"); - break; + /* From the Broadwell PRM >> Memory Views >> Common Surface Formats >> + * Surface Layout >> 1D Surfaces: + * + * One-dimensional surfaces are identical to 2D surfaces with height of one. + * + * So fallthrough... + */ case VK_IMAGE_TYPE_2D: { const uint32_t w0 = align_u32(extent->width, i); const uint32_t h0 = align_u32(extent->height, j); @@ -267,9 +272,6 @@ anv_image_create(VkDevice _device, assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO); - /* XXX: We don't handle any of these */ - anv_assert(pCreateInfo->imageType == VK_IMAGE_TYPE_2D || - pCreateInfo->imageType == VK_IMAGE_TYPE_3D); anv_assert(pCreateInfo->mipLevels > 0); anv_assert(pCreateInfo->arraySize > 0); anv_assert(pCreateInfo->samples == 1); |