mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-12 01:20:17 +01:00
zink: move spec constant emission to the types/consts block
spec constants are used as constants, so emitting them in the instructions block can create mismatched ordering of the constant usage with other types Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19116>
This commit is contained in:
parent
1e51383258
commit
c305a2c962
1 changed files with 7 additions and 1 deletions
|
|
@ -1539,7 +1539,13 @@ SpvId
|
|||
spirv_builder_spec_const_uint(struct spirv_builder *b, int width)
|
||||
{
|
||||
assert(width <= 32);
|
||||
return spirv_builder_emit_unop(b, SpvOpSpecConstant, spirv_builder_type_uint(b, width), 0);
|
||||
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, result);
|
||||
spirv_buffer_emit_word(&b->types_const_defs, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
SpvId
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue