summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Antognolli <[email protected]>2018-02-28 16:11:34 -0800
committerRafael Antognolli <[email protected]>2018-04-05 07:42:45 -0700
commit8735c86ce08155a6cd07addbc848f148d0bc82a9 (patch)
treea98ba90e9a6f13ad47ed66cd9faa1e3615d49851
parentab633c2d6108afc55c7c9f5436296832bdb18492 (diff)
i965/miptree: Add new clear color BO for winsys aux buffers
Add an extra BO to store clear color when we receive the aux buffer from the window system. Since we have no control over the aux buffer size in this case, we need the new BO to store only the clear color. v5: - Better subject (Jordan). - Drop alignment from brw_bo_alloc(). Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index d11ae65243f..89074a64930 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -969,6 +969,23 @@ create_ccs_buf_for_image(struct brw_context *brw,
return false;
}
+ /* On gen10+ we start using an extra space in the aux buffer to store the
+ * indirect clear color. However, if we imported an image from the window
+ * system with CCS, we don't have the extra space at the end of the aux
+ * buffer. So create a new bo here that will store that clear color.
+ */
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
+ if (devinfo->gen >= 10) {
+ mt->mcs_buf->clear_color_bo =
+ brw_bo_alloc(brw->bufmgr, "clear_color_bo",
+ brw->isl_dev.ss.clear_color_state_size);
+ if (!mt->mcs_buf->clear_color_bo) {
+ free(mt->mcs_buf);
+ mt->mcs_buf = NULL;
+ return false;
+ }
+ }
+
mt->mcs_buf->bo = image->bo;
brw_bo_reference(image->bo);