struct isl_surf tmp_surfs[1])
{
if (mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY) {
- const unsigned num_samples = mt->num_samples;
+ const unsigned num_samples = mt->surf.samples;
for (unsigned i = 0; i < num_layers; i++) {
for (unsigned s = 0; s < num_samples; s++) {
const unsigned phys_layer = (start_layer + i) * num_samples + s;
* Note: if the src (or dst) is a 2D multisample array texture on Gen7+ using
* INTEL_MSAA_LAYOUT_UMS or INTEL_MSAA_LAYOUT_CMS, src_layer (dst_layer) is
* the physical layer holding sample 0. So, for example, if
- * src_mt->num_samples == 4, then logical layer n corresponds to src_layer ==
+ * src_mt->surf.samples == 4, then logical layer n corresponds to src_layer ==
* 4*n.
*/
void
DBG("%s from %dx %s mt %p %d %d (%f,%f) (%f,%f)"
"to %dx %s mt %p %d %d (%f,%f) (%f,%f) (flip %d,%d)\n",
__func__,
- src_mt->num_samples, _mesa_get_format_name(src_mt->format), src_mt,
+ src_mt->surf.samples, _mesa_get_format_name(src_mt->format), src_mt,
src_level, src_layer, src_x0, src_y0, src_x1, src_y1,
- dst_mt->num_samples, _mesa_get_format_name(dst_mt->format), dst_mt,
+ dst_mt->surf.samples, _mesa_get_format_name(dst_mt->format), dst_mt,
dst_level, dst_layer, dst_x0, dst_y0, dst_x1, dst_y1,
mirror_x, mirror_y);
* R32_FLOAT, so only the contents of the red channel matters.
*/
if (brw->gen == 6 &&
- src_mt->num_samples > 1 && dst_mt->num_samples <= 1 &&
+ src_mt->surf.samples > 1 && dst_mt->surf.samples <= 1 &&
src_mt->format == dst_mt->format &&
(dst_format == MESA_FORMAT_L_FLOAT32 ||
dst_format == MESA_FORMAT_I_FLOAT32)) {
DBG("%s from %dx %s mt %p %d %d (%d,%d) %dx%d"
"to %dx %s mt %p %d %d (%d,%d)\n",
__func__,
- src_mt->num_samples, _mesa_get_format_name(src_mt->format), src_mt,
+ src_mt->surf.samples, _mesa_get_format_name(src_mt->format), src_mt,
src_level, src_layer, src_x, src_y, src_width, src_height,
- dst_mt->num_samples, _mesa_get_format_name(dst_mt->format), dst_mt,
+ dst_mt->surf.samples, _mesa_get_format_name(dst_mt->format), dst_mt,
dst_level, dst_layer, dst_x, dst_y);
struct isl_surf tmp_surfs[2];
struct intel_mipmap_tree *dst_mt = intel_image->mt;
/* There is support for only up to eight samples. */
- if (src_mt->num_samples > 8 || dst_mt->num_samples > 8)
+ if (src_mt->surf.samples > 8 || dst_mt->surf.samples > 8)
return false;
if (_mesa_get_format_base_format(src_rb->Format) !=
return false;
/* This function applies only to non-multisampled render targets. */
- if (mt->num_samples > 1)
+ if (mt->surf.samples > 1)
return false;
/* MCS is only supported for color buffers */
* accidentally reject a multisampled surface here. We should have
* rejected it earlier by explicitly checking the sample count.
*/
- assert(mt->num_samples == 1);
+ assert(mt->surf.samples == 1);
}
/* Handle the hardware restrictions...
mt->supports_fast_clear = false;
mt->aux_state = NULL;
mt->cpp = _mesa_get_format_bytes(format);
- mt->num_samples = num_samples;
+ mt->surf.samples = num_samples;
mt->compressed = _mesa_is_format_compressed(format);
mt->surf.msaa_layout = ISL_MSAA_LAYOUT_NONE;
mt->refcount = 1;
assert(mt->aux_usage == ISL_AUX_USAGE_NONE);
const unsigned no_flags = 0;
- if (mt->num_samples > 1 && is_mcs_supported(brw, mt->format, no_flags)) {
+ if (mt->surf.samples > 1 && is_mcs_supported(brw, mt->format, no_flags)) {
assert(mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);
mt->aux_usage = ISL_AUX_USAGE_MCS;
} else if (intel_tiling_supports_ccs(brw, mt->tiling) &&
}
int level_depth = mt->level[level].depth;
- if (mt->num_samples > 1 && mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY)
- level_depth /= mt->num_samples;
+ if (mt->surf.samples > 1 && mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY)
+ level_depth /= mt->surf.samples;
/* Test image dimensions against the base level image adjusted for
* minification. This will also catch images not present in the
}
/* Core uses sample number of zero to indicate single-sampled. */
- if (MAX2(image->NumSamples, 1) != mt->num_samples)
+ if (MAX2(image->NumSamples, 1) != mt->surf.samples)
return false;
return true;
case ISL_AUX_USAGE_MCS:
assert(_mesa_is_format_color_format(mt->format));
- assert(mt->num_samples > 1);
- if (!intel_miptree_alloc_mcs(brw, mt, mt->num_samples))
+ assert(mt->surf.samples > 1);
+ if (!intel_miptree_alloc_mcs(brw, mt, mt->surf.samples))
return false;
return true;
case ISL_AUX_USAGE_CCS_E:
assert(_mesa_is_format_color_format(mt->format));
- assert(mt->num_samples == 1);
+ assert(mt->surf.samples == 1);
if (!intel_miptree_alloc_ccs(brw, mt))
return false;
return true;
* There is no such blurb for 1D textures, but there is sufficient evidence
* that this is broken on SKL+.
*/
- return (mt->num_samples == 1 &&
+ return (mt->surf.samples == 1 &&
mt->target != GL_TEXTURE_3D &&
mt->target != GL_TEXTURE_1D /* gen9+ restriction */);
}
(level == 0 && mt->first_level == 0 && mt->last_level == 0));
/* Compression of arrayed msaa surfaces is supported. */
- if (mt->num_samples > 1)
+ if (mt->surf.samples > 1)
return;
/* Fast color clear is supported for non-msaa arrays only on Gen8+. */
if (!mt->mcs_buf)
return;
- if (mt->num_samples > 1) {
+ if (mt->surf.samples > 1) {
/* Nothing to do for MSAA */
assert(aux_supported && fast_clear_supported);
} else {
if (!mt->mcs_buf)
return;
- if (mt->num_samples > 1) {
+ if (mt->surf.samples > 1) {
for (uint32_t a = 0; a < num_layers; a++) {
intel_miptree_finish_mcs_write(brw, mt, level, start_layer + a,
written_with_aux);
if (_mesa_is_format_color_format(mt->format)) {
assert(mt->mcs_buf != NULL);
- assert(mt->num_samples == 1 ||
+ assert(mt->surf.samples == 1 ||
mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);
} else if (mt->format == MESA_FORMAT_S_UINT8) {
unreachable("Cannot get aux state for stencil");
if (_mesa_is_format_color_format(mt->format)) {
assert(mt->mcs_buf != NULL);
- assert(mt->num_samples == 1 ||
+ assert(mt->surf.samples == 1 ||
mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);
} else if (mt->format == MESA_FORMAT_S_UINT8) {
unreachable("Cannot get aux state for stencil");
{
bool aux_supported, clear_supported;
if (_mesa_is_format_color_format(mt->format)) {
- if (mt->num_samples > 1) {
+ if (mt->surf.samples > 1) {
aux_supported = clear_supported = true;
} else {
aux_supported = can_texture_with_ccs(brw, mt, view_format);
* enabled because otherwise the surface state will be programmed with
* the linear equivalent format anyway.
*/
- if (brw->gen == 9 && srgb_enabled && mt->num_samples == 1 &&
+ if (brw->gen == 9 && srgb_enabled && mt->surf.samples == 1 &&
_mesa_get_srgb_format_linear(mt->format) != mt->format) {
/* Lossless compression is not supported for SRGB formats, it
* reached for multisample buffers.
*/
assert(mt->surf.msaa_layout == ISL_MSAA_LAYOUT_NONE ||
- mt->num_samples == 1);
+ mt->surf.samples == 1);
intel_miptree_prepare_access(brw, mt, 0, INTEL_REMAINING_LEVELS,
0, INTEL_REMAINING_LAYERS, false, false);
src->logical_width0,
src->logical_height0,
src->logical_depth0,
- src->num_samples,
+ src->surf.samples,
r8stencil_flags);
assert(mt->r8stencil_mt);
}
{
struct intel_miptree_map *map;
- assert(mt->num_samples == 1 || mt->surf.samples == 1);
+ assert(mt->surf.samples == 1);
map = intel_miptree_attach_map(mt, level, slice, x, y, w, h, mode);
if (!map){
{
struct intel_miptree_map *map = mt->level[level].slice[slice].map;
- assert(mt->num_samples == 1 || mt->surf.samples == 1);
+ assert(mt->surf.samples == 1);
if (!map)
return;
}
surf->levels = mt->last_level - mt->first_level + 1;
- surf->samples = mt->num_samples;
+ surf->samples = mt->surf.samples;
surf->size = 0; /* TODO */
surf->alignment = 0; /* TODO */