<p dir="ltr"></p>
<p dir="ltr">On Jul 16, 2016 3:59 AM, "Alejandro Piñeiro" <<a href="mailto:apinheiro@igalia.com">apinheiro@igalia.com</a>> wrote:<br>
><br>
> Don't know if there are still some missing patches to be submitted to<br>
> master, but this patch caused regressions on skylake on the following<br>
> CTS tests:<br>
><br>
>       *<br>
> GL44-CTS.texture_cube_map_array.image_texture_size.texture_size_compute_sh<br>
>       *<br>
> GL44-CTS.texture_cube_map_array.image_texture_size.texture_size_fragment_sh<br>
>       *<br>
> GL44-CTS.texture_cube_map_array.image_texture_size.texture_size_geometry_sh<br>
>       *<br>
> GL44-CTS.texture_cube_map_array.image_texture_size.texture_size_tesselation_con_sh<br>
>       *<br>
> GL44-CTS.texture_cube_map_array.image_texture_size.texture_size_tesselation_ev_sh<br>
>       *<br>
> GL44-CTS.texture_cube_map_array.image_texture_size.texture_size_vertex_sh</p>
<p dir="ltr">Thanks, I'll take a look on Monday.  If textureSize is returning the wrong thing, do you know what it is returning?  Also, are you sure it's this patch and not the similarly titled one for gen8?  When I go to reproduce this, will I need a special branch of the CTS?</p>
<p dir="ltr">--Jason</p>
<p dir="ltr">> On 14/07/16 02:16, Jason Ekstrand wrote:<br>
> > Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
> > ---<br>
> >  src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 94 +-----------------------<br>
> >  1 file changed, 1 insertion(+), 93 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 084bd8c..01c9802 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>
> > @@ -550,98 +550,6 @@ brw_update_buffer_texture_surface(struct gl_context *ctx,<br>
> >                                         false /* rw */);<br>
> >  }<br>
> ><br>
> > -static void<br>
> > -gen4_update_texture_surface(struct gl_context *ctx,<br>
> > -                            unsigned unit,<br>
> > -                            uint32_t *surf_offset,<br>
> > -                            bool for_gather,<br>
> > -                            uint32_t plane)<br>
> > -{<br>
> > -   struct brw_context *brw = brw_context(ctx);<br>
> > -   struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;<br>
> > -   struct intel_texture_object *intelObj = intel_texture_object(tObj);<br>
> > -   struct intel_mipmap_tree *mt = intelObj->mt;<br>
> > -   struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);<br>
> > -   uint32_t *surf;<br>
> > -<br>
> > -   /* BRW_NEW_TEXTURE_BUFFER */<br>
> > -   if (tObj->Target == GL_TEXTURE_BUFFER) {<br>
> > -      brw_update_buffer_texture_surface(ctx, unit, surf_offset);<br>
> > -      return;<br>
> > -   }<br>
> > -<br>
> > -   if (plane > 0) {<br>
> > -      if (mt->plane[plane - 1] == NULL)<br>
> > -         return;<br>
> > -      mt = mt->plane[plane - 1];<br>
> > -   }<br>
> > -<br>
> > -   surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE,<br>
> > -                       6 * 4, 32, surf_offset);<br>
> > -<br>
> > -   mesa_format mesa_fmt = plane == 0 ? intelObj->_Format : mt->format;<br>
> > -   uint32_t tex_format = translate_tex_format(brw, mesa_fmt,<br>
> > -                                              sampler->sRGBDecode);<br>
> > -<br>
> > -   if (for_gather) {<br>
> > -      /* Sandybridge's gather4 message is broken for integer formats.<br>
> > -       * To work around this, we pretend the surface is UNORM for<br>
> > -       * 8 or 16-bit formats, and emit shader instructions to recover<br>
> > -       * the real INT/UINT value.  For 32-bit formats, we pretend<br>
> > -       * the surface is FLOAT, and simply reinterpret the resulting<br>
> > -       * bits.<br>
> > -       */<br>
> > -      switch (tex_format) {<br>
> > -      case BRW_SURFACEFORMAT_R8_SINT:<br>
> > -      case BRW_SURFACEFORMAT_R8_UINT:<br>
> > -         tex_format = BRW_SURFACEFORMAT_R8_UNORM;<br>
> > -         break;<br>
> > -<br>
> > -      case BRW_SURFACEFORMAT_R16_SINT:<br>
> > -      case BRW_SURFACEFORMAT_R16_UINT:<br>
> > -         tex_format = BRW_SURFACEFORMAT_R16_UNORM;<br>
> > -         break;<br>
> > -<br>
> > -      case BRW_SURFACEFORMAT_R32_SINT:<br>
> > -      case BRW_SURFACEFORMAT_R32_UINT:<br>
> > -         tex_format = BRW_SURFACEFORMAT_R32_FLOAT;<br>
> > -         break;<br>
> > -<br>
> > -      default:<br>
> > -         break;<br>
> > -      }<br>
> > -   }<br>
> > -<br>
> > -   surf[0] = (translate_tex_target(tObj->Target) << BRW_SURFACE_TYPE_SHIFT |<br>
> > -           BRW_SURFACE_MIPMAPLAYOUT_BELOW << BRW_SURFACE_MIPLAYOUT_SHIFT |<br>
> > -           BRW_SURFACE_CUBEFACE_ENABLES |<br>
> > -           tex_format << BRW_SURFACE_FORMAT_SHIFT);<br>
> > -<br>
> > -   surf[1] = mt->bo->offset64 + mt->offset; /* reloc */<br>
> > -<br>
> > -   surf[2] = ((intelObj->_MaxLevel - tObj->BaseLevel) << BRW_SURFACE_LOD_SHIFT |<br>
> > -           (mt->logical_width0 - 1) << BRW_SURFACE_WIDTH_SHIFT |<br>
> > -           (mt->logical_height0 - 1) << BRW_SURFACE_HEIGHT_SHIFT);<br>
> > -<br>
> > -   surf[3] = (brw_get_surface_tiling_bits(mt->tiling) |<br>
> > -           (mt->logical_depth0 - 1) << BRW_SURFACE_DEPTH_SHIFT |<br>
> > -           (mt->pitch - 1) << BRW_SURFACE_PITCH_SHIFT);<br>
> > -<br>
> > -   const unsigned min_lod = tObj->MinLevel + tObj->BaseLevel - mt->first_level;<br>
> > -   surf[4] = (brw_get_surface_num_multisamples(mt->num_samples) |<br>
> > -              SET_FIELD(min_lod, BRW_SURFACE_MIN_LOD) |<br>
> > -              SET_FIELD(tObj->MinLayer, BRW_SURFACE_MIN_ARRAY_ELEMENT));<br>
> > -<br>
> > -   surf[5] = mt->valign == 4 ? BRW_SURFACE_VERTICAL_ALIGN_ENABLE : 0;<br>
> > -<br>
> > -   /* Emit relocation to surface contents */<br>
> > -   drm_intel_bo_emit_reloc(brw-><a href="http://batch.bo">batch.bo</a>,<br>
> > -                           *surf_offset + 4,<br>
> > -                           mt->bo,<br>
> > -                           surf[1] - mt->bo->offset64,<br>
> > -                           I915_GEM_DOMAIN_SAMPLER, 0);<br>
> > -}<br>
> > -<br>
> >  /**<br>
> >   * Create the constant buffer surface.  Vertex/fragment shader constants will be<br>
> >   * read from this buffer with Data Port Read instructions/messages.<br>
> > @@ -1678,7 +1586,7 @@ const struct brw_tracked_state brw_wm_image_surfaces = {<br>
> >  void<br>
> >  gen4_init_vtable_surface_functions(struct brw_context *brw)<br>
> >  {<br>
> > -   brw->vtbl.update_texture_surface = gen4_update_texture_surface;<br>
> > +   brw->vtbl.update_texture_surface = brw_update_texture_surface;<br>
> >     brw->vtbl.update_renderbuffer_surface = gen4_update_renderbuffer_surface;<br>
> >     brw->vtbl.emit_null_surface_state = brw_emit_null_surface_state;<br>
> >     brw->vtbl.emit_buffer_surface_state = gen4_emit_buffer_surface_state;<br>
><br>
> _______________________________________________<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">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br></p>