mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 19:50:11 +01:00
i965/fs: Fix and document component().
This fixes a number of bugs of component() by reimplementing it in terms of horiz_offset(): Handling of base registers starting at a non-zero subreg_offset, handling of strided registers and overflow of subreg_offset into reg_offset. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
e209134f71
commit
71fd4942d1
1 changed files with 5 additions and 2 deletions
|
|
@ -128,11 +128,14 @@ horiz_offset(fs_reg reg, unsigned delta)
|
|||
return reg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the scalar channel of \p reg given by \p idx and replicate it to all
|
||||
* channels of the result.
|
||||
*/
|
||||
static inline fs_reg
|
||||
component(fs_reg reg, unsigned idx)
|
||||
{
|
||||
assert(reg.subreg_offset == 0);
|
||||
reg.subreg_offset = idx * type_sz(reg.type);
|
||||
reg = horiz_offset(reg, idx);
|
||||
reg.stride = 0;
|
||||
return reg;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue