mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
zink: fix spirv_builder_spec_const_uint
We need to create the type upfront otherwise the spir-v binary gets
corrupted.
Fixes: c305a2c962 ("zink: move spec constant emission to the types/consts block")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19310>
This commit is contained in:
parent
0c4676a3aa
commit
3128a8cada
1 changed files with 2 additions and 1 deletions
|
|
@ -1547,10 +1547,11 @@ SpvId
|
|||
spirv_builder_spec_const_uint(struct spirv_builder *b, int width)
|
||||
{
|
||||
assert(width <= 32);
|
||||
SpvId const_type = spirv_builder_type_uint(b, width);
|
||||
SpvId result = spirv_builder_new_id(b);
|
||||
spirv_buffer_prepare(&b->types_const_defs, b->mem_ctx, 4);
|
||||
spirv_buffer_emit_word(&b->types_const_defs, SpvOpSpecConstant | (4 << 16));
|
||||
spirv_buffer_emit_word(&b->types_const_defs, spirv_builder_type_uint(b, width));
|
||||
spirv_buffer_emit_word(&b->types_const_defs, const_type);
|
||||
spirv_buffer_emit_word(&b->types_const_defs, result);
|
||||
/* this is the default value for spec constants;
|
||||
* if any users need a different default, add a param to pass for it
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue