intel/blorp: Work in terms of logical array layers

When Ivy Bridge introduced array multisampling, someone made the decision
to do lots of stuff throughout the driver in terms of physical array layers
rather than logical array layers.  In ISL, we use logical array layers most
of the time and it really makes no sense to use physical array layers in
the blorp API.  Every time someone passes physical array layers into blorp
for an array multisampled surface, they're always divisible by the number
of samples and we divide right away.

Eventually, I'd like to rework most of the GL driver internals to use
logical array layers but that's going to be a big project and will probably
happen as part of the ISL conversion.  For now, we'll do the conversion in
brw_blorp and let blorp just use the logical layers.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Jason Ekstrand
2016-09-03 11:40:09 -07:00
parent fa4627149d
commit 54db5afd2c
2 changed files with 29 additions and 16 deletions

View File

@@ -64,16 +64,6 @@ brw_blorp_surface_info_init(struct blorp_context *blorp,
unsigned int level, unsigned int layer,
enum isl_format format, bool is_render_target)
{
/* Layer is a physical layer, so if this is a 2D multisample array texture
* using INTEL_MSAA_LAYOUT_UMS or INTEL_MSAA_LAYOUT_CMS, then it had better
* be a multiple of num_samples.
*/
unsigned layer_multiplier = 1;
if (surf->surf->msaa_layout == ISL_MSAA_LAYOUT_ARRAY) {
assert(layer % surf->surf->samples == 0);
layer_multiplier = surf->surf->samples;
}
if (format == ISL_FORMAT_UNSUPPORTED)
format = surf->surf->format;
@@ -126,9 +116,9 @@ brw_blorp_surface_info_init(struct blorp_context *blorp,
* guaranteed that we won't be doing any funny surface hacks.
*/
info->view.base_array_layer = 0;
info->z_offset = layer / layer_multiplier;
info->z_offset = layer;
} else {
info->view.base_array_layer = layer / layer_multiplier;
info->view.base_array_layer = layer;
assert(info->view.array_len >= info->view.base_array_layer);
info->view.array_len -= info->view.base_array_layer;