zink: add spirv builder function for runtime array type

we'll need this for ssbos

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>
This commit is contained in:
Mike Blumenkrantz 2020-08-04 14:20:19 -04:00 committed by Marge Bot
parent 652e51e1f3
commit 621fb6a72a
2 changed files with 14 additions and 0 deletions

View File

@ -1086,6 +1086,17 @@ spirv_builder_type_matrix(struct spirv_builder *b, SpvId component_type,
return get_type_def(b, SpvOpTypeMatrix, args, ARRAY_SIZE(args));
}
SpvId
spirv_builder_type_runtime_array(struct spirv_builder *b, SpvId component_type)
{
SpvId type = spirv_builder_new_id(b);
spirv_buffer_prepare(&b->types_const_defs, b->mem_ctx, 3);
spirv_buffer_emit_word(&b->types_const_defs, SpvOpTypeRuntimeArray | (3 << 16));
spirv_buffer_emit_word(&b->types_const_defs, type);
spirv_buffer_emit_word(&b->types_const_defs, component_type);
return type;
}
SpvId
spirv_builder_type_array(struct spirv_builder *b, SpvId component_type,
SpvId length)

View File

@ -336,6 +336,9 @@ SpvId
spirv_builder_type_matrix(struct spirv_builder *b, SpvId component_type,
unsigned component_count);
SpvId
spirv_builder_type_runtime_array(struct spirv_builder *b, SpvId component_type);
SpvId
spirv_builder_type_array(struct spirv_builder *b, SpvId component_type,
SpvId length);