summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2013-06-17 14:05:21 -0700
committerJordan Justen <jordan.l.justen@intel.com>2013-06-18 14:06:46 -0700
commitadeda5afd428e2e4a2c0ef0b6367956d94c4d054 (patch)
tree471ed8265ac1797eeb5d5608627c346fa396c816
parent248fddecd8e813b9cb0c98327ab4cd3c836f7398 (diff)
gen7: fix GPU hang on WebGL texture-size test
When rendering to a texture with BaseLevel set, the miptree may be laid out such that BaseLevel is in level 0 of the miptree (to avoid wasting memory on unused levels between 0 and BaseLevel-1). In that case, we have to shift our render target's level down to the appropriate level of the smaller miptree. The WebGL test in combination with a meta code relating to glGenerateMipmap also triggered a similar failure scenario. This GPU hang regression was introduced by c754f7a8. Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=65324 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Paul Berry <stereotype441@gmail.com>
-rw-r--r--src/mesa/drivers/dri/i965/gen7_wm_surface_state.c2
1 files changed, 1 insertions, 1 deletions
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 1a4e416d777..c2699ab817e 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
@@ -597,7 +597,7 @@ gen7_update_renderbuffer_surface(struct brw_context *brw,
assert(brw->has_surface_tile_offset);
- surf[5] = irb->mt_level;
+ surf[5] = irb->mt_level - irb->mt->first_level;
surf[2] = SET_FIELD(irb->mt->logical_width0 - 1, GEN7_SURFACE_WIDTH) |
SET_FIELD(irb->mt->logical_height0 - 1, GEN7_SURFACE_HEIGHT);