From 622a317e4c6163190508fecec82111520a84015e Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Mon, 14 Sep 2015 14:37:09 -0700 Subject: vk/image: Teach vkCreateImage about layout of 1D surfaces Calling vkCreateImage() with VK_IMAGE_TYPE_1D now succeeds and computes the surface layout correctly. --- src/vulkan/anv_image.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') 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); -- cgit v1.2.3