mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 16:38:17 +02:00
panfrost: fix texel buffer calculations
We were computing some positions using `void*` rather than pointers to
the appropriate structures. This caused bad pointers, the effect of
which depended on the current memory environment -- tests related to
texel buffers could pass or not depending on what other tests had run
previously.
Fixes: a21ee564e2 ("pan/bi: Make texel buffers use Attribute Buffers")
Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40459>
This commit is contained in:
parent
d18db3e33d
commit
0142e2e5e3
1 changed files with 4 additions and 4 deletions
|
|
@ -2244,18 +2244,18 @@ panfrost_emit_image_texbuf_attribs(struct panfrost_batch *batch,
|
|||
emit_image_bufs(batch, type, bufs.cpu, image_mask);
|
||||
|
||||
#if PAN_ARCH >= 6
|
||||
struct mali_attribute_packed *attr_array = attribs.cpu;
|
||||
struct mali_attribute_buffer_packed *attrib_bufs = bufs.cpu;
|
||||
/* Texel buffers come after the images, which require two buffers per image. */
|
||||
unsigned image_buf_offset = image_count * 2;
|
||||
emit_texbuf_attribs(ctx, type, attribs.cpu + image_count, image_buf_offset);
|
||||
emit_texbuf_bufs(ctx, type, bufs.cpu + image_buf_offset);
|
||||
emit_texbuf_attribs(ctx, type, attr_array + image_count, image_buf_offset);
|
||||
emit_texbuf_bufs(ctx, type, attrib_bufs + image_buf_offset);
|
||||
|
||||
/* We need an empty attrib buf to stop the prefetching on Bifrost */
|
||||
struct mali_attribute_buffer_packed *attrib_bufs = bufs.cpu;
|
||||
pan_pack(&attrib_bufs[buf_count - 1], ATTRIBUTE_BUFFER, cfg)
|
||||
;
|
||||
|
||||
/* Ensure any shader read attributes that are not bound behave properly */
|
||||
struct mali_attribute_packed *attr_array = attribs.cpu;
|
||||
for (unsigned i = bound_attrib_count; i < attrib_array_size; ++i) {
|
||||
pan_pack(&attr_array[i], ATTRIBUTE, cfg)
|
||||
cfg.format = MALI_PACK_FMT(CONSTANT, 0000, L);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue