mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
intel/fs: Fix fs_reg::component_size() to handle two-dimensional register regions.
Add code to calculate the size in bytes of arbitrary two-dimensional regions for FIXED_GRF and ARF registers. Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
This commit is contained in:
parent
83a0252e8d
commit
a844c0b185
1 changed files with 10 additions and 4 deletions
|
|
@ -562,10 +562,16 @@ fs_reg::is_contiguous() const
|
|||
unsigned
|
||||
fs_reg::component_size(unsigned width) const
|
||||
{
|
||||
const unsigned stride = ((file != ARF && file != FIXED_GRF) ? this->stride :
|
||||
hstride == 0 ? 0 :
|
||||
1 << (hstride - 1));
|
||||
return MAX2(width * stride, 1) * type_sz(type);
|
||||
if (file == ARF || file == FIXED_GRF) {
|
||||
const unsigned w = MIN2(width, 1u << this->width);
|
||||
const unsigned h = width >> this->width;
|
||||
const unsigned vs = vstride ? 1 << (vstride - 1) : 0;
|
||||
const unsigned hs = hstride ? 1 << (hstride - 1) : 0;
|
||||
assert(w > 0);
|
||||
return ((MAX2(1, h) - 1) * vs + (w - 1) * hs + 1) * type_sz(type);
|
||||
} else {
|
||||
return MAX2(width * stride, 1) * type_sz(type);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue