iris_blorp_surf_for_resource(&batch->screen->isl_dev, &surf,
p_res, res->aux.usage, level, true);
- /* Use the linear version of the format to avoid using an invalid surface
- * state on gen9. ISL_AUX_USAGE_CCS_E is not supported for sRGB formats on
- * gen9 but iris may still assign that aux usage to resources with that
- * format through the modifier interface.
- */
- blorp_fast_clear(&blorp_batch, &surf, isl_format_srgb_to_linear(format),
- ISL_SWIZZLE_IDENTITY,
+ blorp_fast_clear(&blorp_batch, &surf, format, ISL_SWIZZLE_IDENTITY,
level, box->z, box->depth,
box->x, box->y, box->x + box->width,
box->y + box->height);
/* At this point, we might have fast cleared the depth buffer. So if there's
* no stencil clear pending, return early.
*/
- if (!(clear_depth || clear_stencil)) {
+ if (!(clear_depth || (clear_stencil && stencil_res))) {
return;
}
iris_resource_finish_aux_import(ctx->screen, res);
if (util_format_is_depth_or_stencil(p_res->format)) {
- const struct util_format_description *fmt_desc =
- util_format_description(p_res->format);
+ const struct util_format_unpack_description *unpack =
+ util_format_unpack_description(p_res->format);
float depth = 0.0;
uint8_t stencil = 0;
- if (fmt_desc->unpack_z_float)
+ if (unpack->unpack_z_float)
util_format_unpack_z_float(p_res->format, &depth, data, 1);
- if (fmt_desc->unpack_s_8uint)
+ if (unpack->unpack_s_8uint)
util_format_unpack_s_8uint(p_res->format, &stencil, data, 1);
clear_depth_stencil(ice, p_res, level, box, true, true, true,