mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 14:38:06 +02:00
vk/meta: Make sure texel is 32-bit in build_buffer_to_image_cs()
Just like fragment stores, image stores expect 32-bit values (at least that's the case of the Bifrost backend), so make sure the value passed to write_img() is always 32-bit, even when convert_texel() doesn't touch the texel because the image view format matches the buffer format. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Tested-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31227>
This commit is contained in:
parent
b4900cd3f8
commit
e171579f51
1 changed files with 7 additions and 0 deletions
|
|
@ -1144,6 +1144,13 @@ build_buffer_to_image_cs(const struct vk_meta_device *meta,
|
|||
|
||||
texel = convert_texel(b, buf_fmt, img_fmt, texel);
|
||||
|
||||
/* If the image view format matches buf_fmt, convert_texel() does nothing,
|
||||
* but we still need to promote the texel to a 32-bit unsigned integer,
|
||||
* because write_img() wants a 32-bit value.
|
||||
*/
|
||||
if (texel->bit_size < 32)
|
||||
texel = nir_u2u32(b, texel);
|
||||
|
||||
write_img(b, &key->img.view, key->img.aspect, VK_SAMPLE_COUNT_1_BIT,
|
||||
image_deref, img_coords, NULL, texel);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue