mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 20:10:14 +01:00
intel/brw: Ensure BROADCAST() value respect register alignment
If we have a non-register-aligned source, MOV it to a new register so that the invariant expected when generating SHADER_OPCODE_BROADCAST is respected. Added to ensure a later patch won't hit the `src.subnr == 0` assertion in brw_broadcast() generation code. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31029>
This commit is contained in:
parent
d97381efd8
commit
f20df2984d
1 changed files with 7 additions and 0 deletions
|
|
@ -773,6 +773,13 @@ namespace brw {
|
|||
BROADCAST(brw_reg value, brw_reg index) const
|
||||
{
|
||||
const brw_reg dst = vgrf(value.type);
|
||||
|
||||
/* Ensure that the source of a broadcast is always register aligned.
|
||||
* See brw_broadcast() non-scalar case for more details.
|
||||
*/
|
||||
if (reg_offset(value) % (REG_SIZE * reg_unit(shader->devinfo)) != 0)
|
||||
value = MOV(value);
|
||||
|
||||
exec_all().emit(SHADER_OPCODE_BROADCAST, dst, value, index);
|
||||
return component(dst, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue