mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 02:00:21 +01:00
nir/lower_printf: fix vectors with nir_printf_fmt
for specifiers like %v4f, we need to store the whole vector. u_printf can already handle this from OpenCL, we just need to match that here. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34909>
This commit is contained in:
parent
90d966f9fa
commit
52cc6c101f
1 changed files with 2 additions and 1 deletions
|
|
@ -263,6 +263,7 @@ nir_vprintf_fmt(nir_builder *b, unsigned ptr_bit_size, const char *fmt, va_list
|
|||
|
||||
ASSERTED nir_def *def = va_arg(ap, nir_def *);
|
||||
assert(def->bit_size / 8 == arg_size);
|
||||
arg_size *= def->num_components;
|
||||
|
||||
info.num_args++;
|
||||
info.arg_sizes = reralloc(b->shader, info.arg_sizes, unsigned,
|
||||
|
|
@ -300,7 +301,7 @@ nir_vprintf_fmt(nir_builder *b, unsigned ptr_bit_size, const char *fmt, va_list
|
|||
nir_def *def = va_arg(ap, nir_def *);
|
||||
|
||||
nir_store_global(b, nir_iadd_imm(b, store_addr, store_offset),
|
||||
4, def, 0x1);
|
||||
4, def, nir_component_mask(def->num_components));
|
||||
|
||||
store_offset += info.arg_sizes[a];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue