Commit ad424b22 authored by Jason Ekstrand's avatar Jason Ekstrand Committed by Jason Ekstrand

i965/miptree: Use the tiling from the modifier instead of the BO

This fixes a bug where we were taking the tiling from the BO regardless
of what the modifier said.  When we got images in from Vulkan where it
doesn't set the tiling on the BO, we would treat them as linear even
though the modifier expressly said to treat it as Y-tiled.
Reviewed-by: Daniel Stone's avatarDaniel Stone <>
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <>
parent 0465dd13
......@@ -990,7 +990,11 @@ intel_miptree_create_for_dri_image(struct brw_context *brw,
uint32_t bo_tiling, bo_swizzle;
brw_bo_get_tiling(image->bo, &bo_tiling, &bo_swizzle);
const enum isl_tiling tiling = isl_tiling_from_i915_tiling(bo_tiling);
const struct isl_drm_modifier_info *mod_info =
const enum isl_tiling tiling =
mod_info ? mod_info->tiling : isl_tiling_from_i915_tiling(bo_tiling);
if (image->planar_format && image->planar_format->nplanes > 1)
return miptree_create_for_planar_image(brw, image, target, tiling);
......@@ -1014,9 +1018,6 @@ intel_miptree_create_for_dri_image(struct brw_context *brw,
if (!brw->ctx.TextureFormatSupported[format])
return NULL;
const struct isl_drm_modifier_info *mod_info =
enum intel_miptree_create_flags mt_create_flags = 0;
/* If this image comes in from a window system, we have different
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment