summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-02-04 09:32:06 -0800
committerEric Anholt <[email protected]>2013-02-04 13:58:55 -0800
commit5751d0cb2dd6d1682d2a954e3f008be61b4ab7e2 (patch)
tree09d60528f23ba4d49c5be28c4ed03a652f19f96a /src
parent4161d70bba567e6e73d5e9e993a74d81930d0e72 (diff)
i965: Fix segfaults from 45a28a927ab7f29ff325b9326d386a39ba538c18
If you look up a level that isn't in the miptree, you crash. Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/gen7_wm_surface_state.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index e732b6d9b8e..f8251b2f0fe 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -871,7 +871,8 @@ brw_update_texture_surface(struct gl_context *ctx,
surf[4] = 0;
- intel_miptree_get_tile_offsets(intelObj->mt, 0, 0, &tile_x, &tile_y);
+ intel_miptree_get_tile_offsets(intelObj->mt, firstImage->Level, 0,
+ &tile_x, &tile_y);
assert(brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0));
/* Note that the low bits of these fields are missing, so
* there's the possibility of getting in trouble.
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
index 9c8bc17d5cb..179024afc79 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
@@ -334,7 +334,8 @@ gen7_update_texture_surface(struct gl_context *ctx,
surf[3] = SET_FIELD(depth - 1, BRW_SURFACE_DEPTH) |
((intelObj->mt->region->pitch) - 1);
- intel_miptree_get_tile_offsets(intelObj->mt, 0, 0, &tile_x, &tile_y);
+ intel_miptree_get_tile_offsets(intelObj->mt, firstImage->Level, 0,
+ &tile_x, &tile_y);
assert(brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0));
/* Note that the low bits of these fields are missing, so
* there's the possibility of getting in trouble.