zink: add ntv util function for getting image type

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
This commit is contained in:
Mike Blumenkrantz 2020-11-17 18:17:10 -05:00 committed by Marge Bot
parent 263d3ae188
commit 177a42333f
1 changed files with 12 additions and 0 deletions

View File

@ -64,6 +64,18 @@ zink_sampler_type(const struct glsl_type *type)
return 0;
}
static inline VkDescriptorType
zink_image_type(const struct glsl_type *type)
{
assert(glsl_type_is_image(type));
if (glsl_get_sampler_dim(type) < GLSL_SAMPLER_DIM_BUF || glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_MS)
return VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_BUF)
return VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER;
unreachable("unimplemented");
return 0;
}
struct nir_shader;
bool