brw/emit: Fix BROADCAST when value is uniform and index is immediate

Fixes: c74511f5dc ("i965: Introduce the BROADCAST pseudo-opcode.")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Tried-to-help-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32668>
This commit is contained in:
Ian Romanick
2024-12-16 16:12:25 -08:00
committed by Marge Bot
parent da4e2af010
commit b4d472cd67

View File

@@ -1936,7 +1936,7 @@ brw_broadcast(struct brw_codegen *p,
* We will typically not get here if the optimizer is doing its job, but
* asserting would be mean.
*/
const unsigned i = idx.file == IMM ? idx.ud : 0;
const unsigned i = (src.vstride == 0 && src.hstride == 0) ? 0 : idx.ud;
src = stride(suboffset(src, i), 0, 1, 0);
if (brw_type_size_bytes(src.type) > 4 && !devinfo->has_64bit_int) {