<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 14, 2016 at 3:10 PM, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@intel.com" target="_blank">chad.versace@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed 13 Jul 2016, Jason Ekstrand wrote:<br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 32 ++++++++++++++++--------<br>
> 1 file changed, 21 insertions(+), 11 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> index 65a1f3c..5873ea5 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> @@ -1400,22 +1400,32 @@ update_image_surface(struct brw_context *brw,<br>
> access != GL_READ_ONLY);<br>
><br>
> } else {<br>
> - const unsigned min_layer = obj->MinLayer + u->_Layer;<br>
> - const unsigned min_level = obj->MinLevel + u->Level;<br>
> const unsigned num_layers = (!u->Layered ? 1 :<br>
> obj->Target == GL_TEXTURE_CUBE_MAP ? 6 :<br>
> mt->logical_depth0);<br>
> - const GLenum target = (obj->Target == GL_TEXTURE_CUBE_MAP ||<br>
> - obj->Target == GL_TEXTURE_CUBE_MAP_ARRAY ?<br>
> - GL_TEXTURE_2D_ARRAY : obj->Target);<br>
> +<br>
> + struct isl_view view = {<br>
> + .format = format,<br>
> + .base_level = obj->MinLevel + u->Level,<br>
> + .levels = 1,<br>
> + .base_array_layer = obj->MinLayer + u->_Layer,<br>
> + .array_len = num_layers,<br>
<br>
</div></div>FYI, I carefully checked that replacing<br>
brw->vtbl.emit_texture_surface_state(..., min_layer + num_layers, ...)<br>
with<br>
<span class=""> .base_array_layer = obj->MinLayer + u->_Layer,<br>
</span> .array_len = num_layers,<br>
does the correct thing.<br>
<span class=""><br>
> + .channel_select = {<br>
> + ISL_CHANNEL_SELECT_RED,<br>
> + ISL_CHANNEL_SELECT_GREEN,<br>
> + ISL_CHANNEL_SELECT_BLUE,<br>
> + ISL_CHANNEL_SELECT_ALPHA,<br>
> + },<br>
> + .usage = ISL_SURF_USAGE_STORAGE_BIT,<br>
> + };<br>
> +<br>
> const int surf_index = surf_offset - &brw->wm.base.surf_offset[0];<br>
><br>
> - brw->vtbl.emit_texture_surface_state(<br>
> - brw, mt, target,<br>
> - min_layer, min_layer + num_layers,<br>
> - min_level, min_level + 1,<br>
> - format, SWIZZLE_XYZW,<br>
> - surf_offset, surf_index, access != GL_READ_ONLY, false);<br>
> + brw_emit_surface_state(brw, mt, &view,<br>
> + surface_state_infos[brw->gen].rb_mocs, false,<br>
> + surf_offset, surf_index,<br>
> + I915_GEM_DOMAIN_SAMPLER,<br>
> + I915_GEM_DOMAIN_SAMPLER);<br>
> }<br>
<br>
</span>I have concerns about the gem write domain. If I read<br>
gen8_update_texture_surface() correctly, then pre-patch the last<br>
argument to brw_emit_surface_state() was effectively<br>
access == GL_READ_ONLY ? 0 : I915_GEM_DOMAIN_SAMPLER<br>
I don't want to change the gem write domain without justification.<br></blockquote><div><br></div><div>I talked to Curro about this briefly. Doing what you say above is probably best.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> update_texture_image_param(brw, u, surface_idx, param);<br>
</blockquote></div><br></div></div>