summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-06-22 15:33:44 -0700
committerJason Ekstrand <[email protected]>2016-08-17 14:46:22 -0700
commitb82de88008ddfef051eeccfbc4b36e0e7d47daf3 (patch)
treecb8cd3e76320ca124291362d6db118df7ab5c8b8 /src/mesa
parentffeb5f67ac46ec53d3c960d883e45d95080f0cf8 (diff)
i965/blorp: Create the isl_surf up-front
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp.c25
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp.h5
2 files changed, 19 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index e0d95264594..5889e95852a 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -51,6 +51,16 @@ brw_blorp_surface_info_init(struct brw_context *brw,
intel_miptree_check_level_layer(mt, level, layer);
info->mt = mt;
+
+ intel_miptree_get_isl_surf(brw, mt, &info->surf);
+
+ if (mt->mcs_mt) {
+ intel_miptree_get_aux_isl_surf(brw, mt, &info->aux_surf,
+ &info->aux_usage);
+ } else {
+ info->aux_usage = ISL_AUX_USAGE_NONE;
+ }
+
info->level = level;
info->layer = layer;
info->width = minify(mt->physical_width0, level - mt->first_level);
@@ -273,8 +283,7 @@ brw_blorp_emit_surface_state(struct brw_context *brw,
{
const struct surface_state_info ss_info = surface_state_infos[brw->gen];
- struct isl_surf surf;
- intel_miptree_get_isl_surf(brw, surface->mt, &surf);
+ struct isl_surf surf = surface->surf;
/* Stomp surface dimensions and tiling (if needed) with info from blorp */
surf.dim = ISL_SURF_DIM_2D;
@@ -315,16 +324,10 @@ brw_blorp_emit_surface_state(struct brw_context *brw,
union isl_color_value clear_color = { .u32 = { 0, 0, 0, 0 } };
- struct isl_surf *aux_surf = NULL, aux_surf_s;
+ const struct isl_surf *aux_surf = NULL;
uint64_t aux_offset = 0;
- enum isl_aux_usage aux_usage = ISL_AUX_USAGE_NONE;
if (surface->mt->mcs_mt) {
- /* We should probably to similar stomping to above but most of the aux
- * surf gets ignored when we fill out the surface state anyway so
- * there's no point.
- */
- intel_miptree_get_aux_isl_surf(brw, surface->mt, &aux_surf_s, &aux_usage);
- aux_surf = &aux_surf_s;
+ aux_surf = &surface->aux_surf;
assert(surface->mt->mcs_mt->offset == 0);
aux_offset = surface->mt->mcs_mt->bo->offset64;
@@ -362,7 +365,7 @@ brw_blorp_emit_surface_state(struct brw_context *brw,
isl_surf_fill_state(&brw->isl_dev, dw, .surf = &surf, .view = &view,
.address = surface->mt->bo->offset64 + offset,
- .aux_surf = aux_surf, .aux_usage = aux_usage,
+ .aux_surf = aux_surf, .aux_usage = surface->aux_usage,
.aux_address = aux_offset,
.mocs = mocs, .clear_color = clear_color,
.x_offset_sa = tile_x, .y_offset_sa = tile_y);
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h
index beef90e8318..e23f48b1a12 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp.h
@@ -71,6 +71,11 @@ struct brw_blorp_surface_info
{
struct intel_mipmap_tree *mt;
+ struct isl_surf surf;
+
+ struct isl_surf aux_surf;
+ enum isl_aux_usage aux_usage;
+
/**
* The miplevel to use.
*/