nvk: add linear image creation support.

the dEQP-VK.draw.* tests use a tiled + linear image and copy between
them.

This fixes the result gathering, not the actual result.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand
2023-01-30 20:11:53 -06:00
committed by Marge Bot
parent f28bf4407d
commit 8dff06aada
3 changed files with 9 additions and 0 deletions

View File

@@ -94,6 +94,9 @@ static struct nil_tiling
choose_tiling(struct nil_extent4d extent_B,
enum nil_image_usage_flags usage)
{
if (usage & NIL_IMAGE_USAGE_LINEAR_BIT)
return (struct nil_tiling) { .is_tiled = false };
struct nil_tiling tiling = {
.is_tiled = true,
.gob_height_8 = true,

View File

@@ -24,6 +24,7 @@ enum nil_image_usage_flags {
NIL_IMAGE_USAGE_STORAGE_BIT = BITFIELD_BIT(4),
NIL_IMAGE_USAGE_CUBE_BIT = BITFIELD_BIT(5),
NIL_IMAGE_USAGE_2D_VIEW_BIT = BITFIELD_BIT(6),
NIL_IMAGE_USAGE_LINEAR_BIT = BITFIELD_BIT(7),
};
enum PACKED nil_view_type {

View File

@@ -195,6 +195,10 @@ static VkResult nvk_image_init(struct nvk_device *device,
{
vk_image_init(&device->vk, &image->vk, pCreateInfo);
enum nil_image_usage_flags usage = 0; /* TODO */
if (pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR)
usage |= NIL_IMAGE_USAGE_LINEAR_BIT;
struct nil_image_init_info nil_info = {
.dim = vk_image_type_to_nil_dim(pCreateInfo->imageType),
.format = vk_format_to_pipe_format(pCreateInfo->format),
@@ -206,6 +210,7 @@ static VkResult nvk_image_init(struct nvk_device *device,
},
.levels = pCreateInfo->mipLevels,
.samples = pCreateInfo->samples,
.usage = usage,
};
ASSERTED bool ok = nil_image_init(nvk_device_physical(device)->dev,