zink: add color output bit and/or use linear tiling for sampled images

these need to have some way to get data onto them

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
This commit is contained in:
Mike Blumenkrantz 2021-02-03 15:32:52 -05:00
parent 0a0fb85fbe
commit 7edc3f50c1

View file

@ -313,6 +313,16 @@ create_ici(struct zink_screen *screen, const struct pipe_resource *templ, unsign
if (bind & PIPE_BIND_DEPTH_STENCIL)
ici.usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
/* this is unlikely to occur and has been included for completeness */
else if (bind & PIPE_BIND_SAMPLER_VIEW && !(ici.usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT)) {
if (feats & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)
ici.usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
else {
if (ici.tiling != VK_IMAGE_TILING_LINEAR)
/* gotta populate this thing somehow */
return create_ici(screen, templ, bind | PIPE_BIND_LINEAR);
}
}
if (templ->flags & PIPE_RESOURCE_FLAG_SPARSE)
ici.usage |= VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT;