From d61162af50bcdb5035de0fb75e3f1cfff706551c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 3 Jun 2021 11:07:45 -0400 Subject: [PATCH] panfrost: Zero r_dimension for buffer textures Instead of reading wrong side of the union (undefined behaviour). Fixes a GenXML assertion failure in KHR-GLES31.core.texture_buffer.texture_buffer_texture_buffer_range Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index f3f5ac7..abf6bd3 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1562,7 +1562,8 @@ emit_image_bufs(struct panfrost_batch *batch, enum pipe_shader_type shader, pan_pack(bufs + (i * 2) + 1, ATTRIBUTE_BUFFER_CONTINUATION_3D, cfg) { cfg.s_dimension = rsrc->base.width0; cfg.t_dimension = rsrc->base.height0; - cfg.r_dimension = is_3d ? rsrc->base.depth0 : + cfg.r_dimension = is_buffer ? 1 : + is_3d ? rsrc->base.depth0 : image->u.tex.last_layer - image->u.tex.first_layer + 1; cfg.row_stride = -- 2.7.4