return;
brw_bo_unreference(aux_buf->bo);
+ brw_bo_unreference(aux_buf->clear_color_bo);
free(aux_buf);
}
return false;
buf->size = aux_surf->size;
+
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
+ if (devinfo->gen >= 10) {
+ /* On CNL, instead of setting the clear color in the SURFACE_STATE, we
+ * will set a pointer to a dword somewhere that contains the color. So,
+ * allocate the space for the clear color value here on the aux buffer.
+ */
+ buf->clear_color_offset = buf->size;
+ buf->size += brw->isl_dev.ss.clear_color_state_size;
+ }
+
buf->pitch = aux_surf->row_pitch;
buf->qpitch = isl_surf_get_array_pitch_sa_rows(aux_surf);
return NULL;
}
+ if (devinfo->gen >= 10) {
+ buf->clear_color_bo = buf->bo;
+ brw_bo_reference(buf->clear_color_bo);
+ }
+
buf->surf = *aux_surf;
return buf;
* @see 3DSTATE_HIER_DEPTH_BUFFER.SurfaceQPitch
*/
uint32_t qpitch;
+
+ /**
+ * Buffer object containing the indirect clear color.
+ *
+ * @see create_ccs_buf_for_image
+ * @see RENDER_SURFACE_STATE.ClearValueAddress
+ */
+ struct brw_bo *clear_color_bo;
+
+ /**
+ * Offset into bo where the clear color can be found.
+ *
+ * @see create_ccs_buf_for_image
+ * @see RENDER_SURFACE_STATE.ClearValueAddress
+ */
+ uint32_t clear_color_offset;
};
struct intel_mipmap_tree