if (r)
return r;
- surf->u.legacy.fmask.size = fout.fmaskBytes;
- surf->u.legacy.fmask.alignment = fout.baseAlign;
- surf->u.legacy.fmask.tile_swizzle = 0;
+ surf->fmask_size = fout.fmaskBytes;
+ surf->fmask_alignment = fout.baseAlign;
+ surf->fmask_tile_swizzle = 0;
surf->u.legacy.fmask.slice_tile_max =
(fout.pitch * fout.height) / 64;
assert(xout.tileSwizzle <=
u_bit_consecutive(0, sizeof(surf->tile_swizzle) * 8));
- surf->u.legacy.fmask.tile_swizzle = xout.tileSwizzle;
+ surf->fmask_tile_swizzle = xout.tileSwizzle;
}
}
surf->u.gfx9.fmask.swizzle_mode = fin.swizzleMode;
surf->u.gfx9.fmask.epitch = fout.pitch - 1;
- surf->u.gfx9.fmask_size = fout.fmaskBytes;
- surf->u.gfx9.fmask_alignment = fout.baseAlign;
+ surf->fmask_size = fout.fmaskBytes;
+ surf->fmask_alignment = fout.baseAlign;
/* Compute tile swizzle for the FMASK surface. */
if (config->info.fmask_surf_index &&
return ret;
assert(xout.pipeBankXor <=
- u_bit_consecutive(0, sizeof(surf->u.gfx9.fmask_tile_swizzle) * 8));
- surf->u.gfx9.fmask_tile_swizzle = xout.pipeBankXor;
+ u_bit_consecutive(0, sizeof(surf->fmask_tile_swizzle) * 8));
+ surf->fmask_tile_swizzle = xout.pipeBankXor;
}
}
surf->num_dcc_levels = 0;
surf->surf_size = 0;
+ surf->fmask_size = 0;
surf->dcc_size = 0;
surf->htile_size = 0;
surf->htile_slice_size = 0;
surf->u.gfx9.surf_offset = 0;
surf->u.gfx9.stencil_offset = 0;
- surf->u.gfx9.fmask_size = 0;
surf->u.gfx9.cmask_size = 0;
/* Calculate texture layout information. */
/* Temporary workaround to prevent VM faults and hangs. */
if (info->family == CHIP_VEGA12)
- surf->u.gfx9.fmask_size *= 8;
+ surf->fmask_size *= 8;
return 0;
}
};
struct legacy_surf_fmask {
- uint64_t size;
- unsigned alignment;
- unsigned tile_swizzle;
unsigned slice_tile_max; /* max 4M */
uint8_t tiling_index; /* max 31 */
uint8_t bankh; /* max 8 */
uint16_t dcc_pitch_max; /* (mip chain pitch - 1) */
uint64_t stencil_offset; /* separate stencil */
- uint64_t fmask_size;
uint64_t cmask_size;
- uint32_t fmask_alignment;
uint32_t cmask_alignment;
-
- uint8_t fmask_tile_swizzle;
};
struct radeon_surf {
* - depth/stencil if HTILE is not TC-compatible and if the gen is not GFX9
*/
uint8_t tile_swizzle;
+ uint8_t fmask_tile_swizzle;
uint64_t surf_size;
+ uint64_t fmask_size;
/* DCC and HTILE are very small. */
uint32_t dcc_size;
uint32_t htile_size;
uint32_t htile_slice_size;
uint32_t surf_alignment;
+ uint32_t fmask_alignment;
uint32_t dcc_alignment;
uint32_t htile_alignment;
struct radv_fmask_info *out)
{
if (device->physical_device->rad_info.chip_class >= GFX9) {
- out->alignment = image->surface.u.gfx9.fmask_alignment;
- out->size = image->surface.u.gfx9.fmask_size;
- out->tile_swizzle = image->surface.u.gfx9.fmask_tile_swizzle;
+ out->alignment = image->surface.fmask_alignment;
+ out->size = image->surface.fmask_size;
+ out->tile_swizzle = image->surface.fmask_tile_swizzle;
return;
}
out->tile_mode_index = image->surface.u.legacy.fmask.tiling_index;
out->pitch_in_pixels = image->surface.u.legacy.fmask.pitch_in_pixels;
out->bank_height = image->surface.u.legacy.fmask.bankh;
- out->tile_swizzle = image->surface.u.legacy.fmask.tile_swizzle;
- out->alignment = image->surface.u.legacy.fmask.alignment;
- out->size = image->surface.u.legacy.fmask.size;
+ out->tile_swizzle = image->surface.fmask_tile_swizzle;
+ out->alignment = image->surface.fmask_alignment;
+ out->size = image->surface.fmask_size;
assert(!out->tile_swizzle || !image->shareable);
}
struct r600_fmask_info *out)
{
if (sscreen->info.chip_class >= GFX9) {
- out->alignment = rtex->surface.u.gfx9.fmask_alignment;
- out->size = rtex->surface.u.gfx9.fmask_size;
- out->tile_swizzle = rtex->surface.u.gfx9.fmask_tile_swizzle;
+ out->alignment = rtex->surface.fmask_alignment;
+ out->size = rtex->surface.fmask_size;
+ out->tile_swizzle = rtex->surface.fmask_tile_swizzle;
return;
}
out->tile_mode_index = rtex->surface.u.legacy.fmask.tiling_index;
out->pitch_in_pixels = rtex->surface.u.legacy.fmask.pitch_in_pixels;
out->bank_height = rtex->surface.u.legacy.fmask.bankh;
- out->tile_swizzle = rtex->surface.u.legacy.fmask.tile_swizzle;
- out->alignment = rtex->surface.u.legacy.fmask.alignment;
- out->size = rtex->surface.u.legacy.fmask.size;
+ out->tile_swizzle = rtex->surface.fmask_tile_swizzle;
+ out->alignment = rtex->surface.fmask_alignment;
+ out->size = rtex->surface.fmask_size;
}
static void si_texture_allocate_fmask(struct si_screen *sscreen,
u_log_printf(log, " FMASK: offset=%"PRIu64", size=%"PRIu64", "
"alignment=%u, swmode=%u, epitch=%u\n",
rtex->fmask.offset,
- rtex->surface.u.gfx9.fmask_size,
- rtex->surface.u.gfx9.fmask_alignment,
+ rtex->surface.fmask_size,
+ rtex->surface.fmask_alignment,
rtex->surface.u.gfx9.fmask.swizzle_mode,
rtex->surface.u.gfx9.fmask.epitch);
}
assert(fmask.u.legacy.level[0].mode == RADEON_SURF_MODE_2D);
- surf_ws->u.legacy.fmask.size = fmask.surf_size;
- surf_ws->u.legacy.fmask.alignment = MAX2(256, fmask.surf_alignment);
- surf_ws->u.legacy.fmask.tile_swizzle = fmask.tile_swizzle;
+ surf_ws->fmask_size = fmask.surf_size;
+ surf_ws->fmask_alignment = MAX2(256, fmask.surf_alignment);
+ surf_ws->fmask_tile_swizzle = fmask.tile_swizzle;
surf_ws->u.legacy.fmask.slice_tile_max =
(fmask.u.legacy.level[0].nblk_x * fmask.u.legacy.level[0].nblk_y) / 64;