mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-25 11:30:29 +01:00
nil: Add a concept of width to tile sizes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26719>
This commit is contained in:
parent
f406206fee
commit
c809e85832
3 changed files with 14 additions and 2 deletions
|
|
@ -194,7 +194,7 @@ nil_tiling_extent_B(struct nil_tiling tiling)
|
|||
{
|
||||
if (tiling.is_tiled) {
|
||||
return (struct nil_extent4d) {
|
||||
.w = NIL_GOB_WIDTH_B, /* Tiles are always 1 GOB wide */
|
||||
.w = NIL_GOB_WIDTH_B << tiling.x_log2,
|
||||
.h = NIL_GOB_HEIGHT(tiling.gob_height_8) << tiling.y_log2,
|
||||
.d = NIL_GOB_DEPTH << tiling.z_log2,
|
||||
.a = 1,
|
||||
|
|
@ -215,6 +215,14 @@ nil_tiling_clamp(struct nil_tiling tiling, struct nil_extent4d extent_B)
|
|||
if (!tiling.is_tiled)
|
||||
return tiling;
|
||||
|
||||
const struct nil_extent4d tiling_extent_B = nil_tiling_extent_B(tiling);
|
||||
|
||||
/* The moment the LOD is smaller than a tile, tiling.x_log2 goes to 0 */
|
||||
if (extent_B.w < tiling_extent_B.w ||
|
||||
extent_B.h < tiling_extent_B.h ||
|
||||
extent_B.d < tiling_extent_B.d)
|
||||
tiling.x_log2 = 0;
|
||||
|
||||
const struct nil_extent4d extent_GOB =
|
||||
nil_extent4d_B_to_GOB(extent_B, tiling.gob_height_8);
|
||||
|
||||
|
|
|
|||
|
|
@ -106,10 +106,12 @@ nil_offset4d_px_to_el(struct nil_offset4d offset_px,
|
|||
struct nil_tiling {
|
||||
bool is_tiled:1;
|
||||
bool gob_height_8:1; /**< GOB height is 4 or 8 */
|
||||
uint8_t x_log2:3; /**< log2 of the Y tile dimension in GOBs */
|
||||
uint8_t y_log2:3; /**< log2 of the Y tile dimension in GOBs */
|
||||
uint8_t z_log2:3; /**< log2 of the Z tile dimension in GOBs */
|
||||
uint8_t pad:5;
|
||||
};
|
||||
static_assert(sizeof(struct nil_tiling) == 1, "This struct has no holes");
|
||||
static_assert(sizeof(struct nil_tiling) == 2, "This struct has no holes");
|
||||
|
||||
struct nil_image_init_info {
|
||||
enum nil_image_dim dim;
|
||||
|
|
|
|||
|
|
@ -330,6 +330,7 @@ nv9097_nil_image_fill_tic(const struct nil_image *image,
|
|||
TH_NV9097_SET_E(th, 2, MEMORY_LAYOUT, BLOCKLINEAR);
|
||||
|
||||
assert(tiling->gob_height_8);
|
||||
assert(tiling->x_log2 == 0);
|
||||
TH_NV9097_SET_E(th, 2, GOBS_PER_BLOCK_WIDTH, ONE_GOB);
|
||||
TH_NV9097_SET_U(th, 2, GOBS_PER_BLOCK_HEIGHT, tiling->y_log2);
|
||||
TH_NV9097_SET_U(th, 2, GOBS_PER_BLOCK_DEPTH, tiling->z_log2);
|
||||
|
|
@ -421,6 +422,7 @@ nvb097_nil_image_fill_tic(const struct nil_image *image,
|
|||
TH_NVB097_SET_E(th, BL, GOBS_PER_BLOCK_WIDTH, ONE_GOB);
|
||||
TH_NVB097_SET_U(th, BL, GOBS_PER_BLOCK_HEIGHT, tiling->y_log2);
|
||||
TH_NVB097_SET_U(th, BL, GOBS_PER_BLOCK_DEPTH, tiling->z_log2);
|
||||
TH_NVB097_SET_U(th, BL, TILE_WIDTH_IN_GOBS, tiling->x_log2);
|
||||
|
||||
TH_NVB097_SET_U(th, BL, TEXTURE_TYPE, pipe_to_nv_texture_type(view->type));
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue