<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 13, 2017 at 12:10 PM, Topi Pohjolainen <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_<wbr>wm_surface_state.c | 18 ++++++++++++++----<br>
1 file changed, 14 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c<br>
index c6cac22e3b..6b05e8ab26 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c<br>
@@ -143,7 +143,10 @@ brw_emit_surface_state(struct brw_context *brw,<br>
<br>
struct isl_surf surf;<br>
<br>
- get_isl_surf(brw, mt, target, &view, &tile_x, &tile_y, &offset, &surf);<br>
+ if (mt->surf.size > 0)<br>
+ surf = mt->surf;<br>
+ else<br>
+ get_isl_surf(brw, mt, target, &view, &tile_x, &tile_y, &offset, &surf);<br>
<br>
union isl_color_value clear_color = { .u32 = { 0, 0, 0, 0 } };<br>
<br>
@@ -559,9 +562,16 @@ brw_update_texture_surface(<wbr>struct gl_context *ctx,<br>
/* If this is a view with restricted NumLayers, then our effective depth<br>
* is not just the miptree depth.<br>
*/<br>
- const unsigned view_num_layers =<br>
- (obj->Immutable && obj->Target != GL_TEXTURE_3D) ? obj->NumLayers :<br>
- mt->logical_depth0;<br>
+ unsigned view_num_layers;<br>
+ if (obj->Immutable && obj->Target != GL_TEXTURE_3D) {<br>
+ view_num_layers = obj->NumLayers;<br>
+ } else if (mt->surf.size > 0) {<br>
+ view_num_layers = mt->surf.dim == ISL_SURF_DIM_3D ?<br>
+ mt->surf.logical_level0_px.<wbr>depth :<br>
+ mt->surf.logical_level0_px.<wbr>array_len;<br></blockquote><div><br></div><div>Strictly speaking, I don't think you need to handle the 3D case specially here. The only thing view_num_layers is used for is to set up the isl_view and ISL ignores array_len for 3D textures.<br><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ } else {<br>
+ view_num_layers = mt->logical_depth0;<br>
+ }<br>
<br>
/* Handling GL_ALPHA as a surface format override breaks 1.30+ style<br>
* texturing functions that return a float, as our code generation always<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>