zink: add util function for checking whether a shader descriptor is a buffer

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
This commit is contained in:
Mike Blumenkrantz 2020-10-30 08:17:07 -04:00
parent 2b18105ff7
commit 12243f682d
1 changed files with 7 additions and 0 deletions

View File

@ -104,4 +104,11 @@ zink_shader_free(struct zink_context *ctx, struct zink_shader *shader);
struct zink_shader *
zink_shader_tcs_create(struct zink_context *ctx, struct zink_shader *vs);
static inline bool
zink_shader_descriptor_is_buffer(struct zink_shader *zs, enum zink_descriptor_type type, unsigned i)
{
return zs->bindings[type][i].type == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER ||
zs->bindings[type][i].type == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER;
}
#endif