i965: Fix segfaults from 45a28a927a
If you look up a level that isn't in the miptree, you crash. Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
This commit is contained in:
parent
4161d70bba
commit
5751d0cb2d
|
@ -871,7 +871,8 @@ brw_update_texture_surface(struct gl_context *ctx,
|
||||||
|
|
||||||
surf[4] = 0;
|
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));
|
assert(brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0));
|
||||||
/* Note that the low bits of these fields are missing, so
|
/* Note that the low bits of these fields are missing, so
|
||||||
* there's the possibility of getting in trouble.
|
* there's the possibility of getting in trouble.
|
||||||
|
|
|
@ -334,7 +334,8 @@ gen7_update_texture_surface(struct gl_context *ctx,
|
||||||
surf[3] = SET_FIELD(depth - 1, BRW_SURFACE_DEPTH) |
|
surf[3] = SET_FIELD(depth - 1, BRW_SURFACE_DEPTH) |
|
||||||
((intelObj->mt->region->pitch) - 1);
|
((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));
|
assert(brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0));
|
||||||
/* Note that the low bits of these fields are missing, so
|
/* Note that the low bits of these fields are missing, so
|
||||||
* there's the possibility of getting in trouble.
|
* there's the possibility of getting in trouble.
|
||||||
|
|
Loading…
Reference in New Issue