gen7: fix GPU hang on WebGL texture-size test
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 <a79006884ba9cf5f4f7fcbb92a15b208780d8c97@intel.com>
Reviewed-by: Eric Anholt <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@anholt.net>
Reviewed-by: Paul Berry <de21b9f22e6dd0bdf7890875d6e07ef4967c44ce@gmail.com>

dellis1972/glsl-optimizer,zz85/glsl-optimizer,mcanthony/glsl-optimizer,mapbox/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,metora/MesaGLSLCompiler,mcanthony/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,mapbox/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,zeux/glsl-optimizer,wolf96/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,djreep81/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,djreep81/glsl-optimizer,wolf96/glsl-optimizer