summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2017-04-25 09:56:33 +0300
committerTopi Pohjolainen <[email protected]>2017-06-19 22:41:45 +0300
commit143e3a679a99334bc1d2e18c1000422782c999ed (patch)
tree45bec01bb4fc9da707be510f61a7157178af092a /src/mesa
parent41a7a0e5488b9725a49f0dcfb93b6612a23ab89c (diff)
i965: Prepare image validation for isl based miptrees
Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c15
1 files changed, 15 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 0fdf7117af8..d589a591042 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1090,6 +1090,21 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
if (mt->target == GL_TEXTURE_CUBE_MAP)
depth = 6;
+ if (mt->surf.size > 0) {
+ if (level >= mt->surf.levels)
+ return false;
+
+ const unsigned level_depth =
+ mt->surf.dim == ISL_SURF_DIM_3D ?
+ minify(mt->surf.logical_level0_px.depth, level) :
+ mt->surf.logical_level0_px.array_len;
+
+ return width == minify(mt->surf.logical_level0_px.width, level) &&
+ height == minify(mt->surf.logical_level0_px.height, level) &&
+ depth == level_depth &&
+ MAX2(image->NumSamples, 1) == mt->surf.samples;
+ }
+
int level_depth = mt->level[level].depth;
if (mt->num_samples > 1) {
switch (mt->msaa_layout) {