From 28f89e96cd3bafae88654793308b46e72479e34c Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Fri, 19 May 2023 11:10:01 +0300 Subject: [PATCH] intel/fs: fix size_read() for LOAD_PAYLOAD With Anv/Zink, the piglit test : arb_shader_storage_buffer_object-max-ssbo-size -auto -fbo fsexceed is failing validation after copy propagation : load_payload(8) vgrf15:F, vgrf1+0.12<0>:F, vgrf1+0.0<0>:F, vgrf1+0.4<0>:F, vgrf1+0.8<0>:F, vgrf1+0.12<0>:F ../src/intel/compiler/brw_fs_validate.cpp:191: A <= B failed A = inst->src[i].offset / REG_SIZE + regs_read(inst, i) = 2 B = alloc.sizes[inst->src[i].nr] = 1 In most cases it works because src[0] would be at offset 0 and so reading a full reg passes validation, but Anv/Zink started emitting slightly different code adding an offset maybe the size read 2 GRFs. Signed-off-by: Lionel Landwerlin Reviewed-by: Francisco Jerez Cc: mesa-stable Part-of: (cherry picked from commit 21c7b55f6fdb91b1312423844e4d6d036dc2f09c) --- .pick_status.json | 2 +- src/intel/compiler/brw_fs.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 9151a7e1b0d..454dac6a363 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -184,7 +184,7 @@ "description": "intel/fs: fix size_read() for LOAD_PAYLOAD", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 0a0ed57fd9a..0af25fa5ea4 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -877,7 +877,7 @@ fs_inst::size_read(int arg) const case SHADER_OPCODE_LOAD_PAYLOAD: if (arg < this->header_size) - return REG_SIZE; + return retype(src[arg], BRW_REGISTER_TYPE_UD).component_size(8); break; case CS_OPCODE_CS_TERMINATE: