From: Nanley Chery Date: Mon, 11 Jun 2018 17:23:23 +0000 (-0700) Subject: i965/miptree: Share tiling_flags in miptree_create X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fbe01625f6bf2cef6742e1ff0d3d44a2afec003e;p=mesa.git i965/miptree: Share tiling_flags in miptree_create Reviewed-by: Topi Pohjolainen --- diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 6c087c0f662..e9ea5b8a70b 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -686,11 +686,16 @@ miptree_create(struct brw_context *brw, enum intel_miptree_create_flags flags) { const struct gen_device_info *devinfo = &brw->screen->devinfo; + isl_tiling_flags_t tiling_flags = ISL_TILING_ANY_MASK; + + /* TODO: This used to be because there wasn't BLORP to handle Y-tiling. */ + if (devinfo->gen < 6 && _mesa_is_format_color_format(format)) + tiling_flags &= ~ISL_TILING_Y0_BIT; if (format == MESA_FORMAT_S_UINT8) return make_surface(brw, target, format, first_level, last_level, width0, height0, depth0, num_samples, - ISL_TILING_W_BIT, + tiling_flags, ISL_SURF_USAGE_STENCIL_BIT | ISL_SURF_USAGE_TEXTURE_BIT, BO_ALLOC_BUSY, @@ -708,7 +713,7 @@ miptree_create(struct brw_context *brw, struct intel_mipmap_tree *mt = make_surface( brw, target, devinfo->gen >= 6 ? depth_only_format : format, first_level, last_level, - width0, height0, depth0, num_samples, ISL_TILING_Y0_BIT, + width0, height0, depth0, num_samples, tiling_flags, ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT, BO_ALLOC_BUSY, 0, NULL); @@ -735,12 +740,6 @@ miptree_create(struct brw_context *brw, if (flags & MIPTREE_CREATE_BUSY) alloc_flags |= BO_ALLOC_BUSY; - isl_tiling_flags_t tiling_flags = ISL_TILING_ANY_MASK; - - /* TODO: This used to be because there wasn't BLORP to handle Y-tiling. */ - if (devinfo->gen < 6) - tiling_flags &= ~ISL_TILING_Y0_BIT; - struct intel_mipmap_tree *mt = make_surface( brw, target, format, first_level, last_level,