asahi: add missing tib alignment check
+ unit test replicating issue. Fixes arb_sample_shading-builtin-gl-sample-mask-mrt-alpha-to-coverage Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
This commit is contained in:
@@ -91,9 +91,9 @@ agx_build_tilebuffer_layout(enum pipe_format *formats, uint8_t nr_cbufs,
|
|||||||
* TODO: Suboptimal, we might be able to reorder render targets to
|
* TODO: Suboptimal, we might be able to reorder render targets to
|
||||||
* avoid fragmentation causing spilling.
|
* avoid fragmentation causing spilling.
|
||||||
*/
|
*/
|
||||||
bool fits =
|
bool fits = (new_offset_B <= MAX_BYTES_PER_SAMPLE) &&
|
||||||
(new_offset_B <= MAX_BYTES_PER_SAMPLE) &&
|
(ALIGN_POT(new_offset_B, 8) * MIN_TILE_SIZE_PX *
|
||||||
(new_offset_B * MIN_TILE_SIZE_PX * nr_samples) <= MAX_BYTES_PER_TILE;
|
nr_samples) <= MAX_BYTES_PER_TILE;
|
||||||
|
|
||||||
if (fits) {
|
if (fits) {
|
||||||
tib._offset_B[rt] = offset_B;
|
tib._offset_B[rt] = offset_B;
|
||||||
|
@@ -128,7 +128,30 @@ struct test tests[] = {
|
|||||||
.tile_size = { 32, 32 },
|
.tile_size = { 32, 32 },
|
||||||
},
|
},
|
||||||
8192
|
8192
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"MRT test that requires spilling to consider alignment requirements",
|
||||||
|
4,
|
||||||
|
{
|
||||||
|
PIPE_FORMAT_R32_FLOAT,
|
||||||
|
PIPE_FORMAT_R32_FLOAT,
|
||||||
|
PIPE_FORMAT_R32_FLOAT,
|
||||||
|
PIPE_FORMAT_R32_FLOAT,
|
||||||
|
PIPE_FORMAT_R32_FLOAT,
|
||||||
|
PIPE_FORMAT_R32_FLOAT,
|
||||||
|
PIPE_FORMAT_R32_FLOAT,
|
||||||
|
PIPE_FORMAT_R32_FLOAT,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.spilled = { false, false, false, false, false, false, true, true },
|
||||||
|
._offset_B = { 0, 4, 8, 12, 16, 20, 0, 0},
|
||||||
|
.sample_size_B = 24,
|
||||||
|
.nr_samples = 4,
|
||||||
|
.tile_size = { 16, 16 },
|
||||||
|
},
|
||||||
|
24576
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user