[Mesa-dev] [PATCH 05/17] i965/gen6 depth surface: calculate more specific surface type

Kenneth Graunke kenneth at whitecape.org
Wed Jul 23 12:23:15 PDT 2014


On Tuesday, July 22, 2014 12:19:48 PM Pohjolainen, Topi wrote:
> On Fri, Jul 18, 2014 at 02:16:40PM -0700, Jordan Justen wrote:
> > (171e633 for gen6)
> > 
> > This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.
> > 
> > Note: Cube maps are treated as 2D arrays with 6 times as
> > many array elements as the cube map array would have.
> > 
> > Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> > ---
> >  src/mesa/drivers/dri/i965/gen6_blorp.cpp     | 17 ++++++++++++++
> >  src/mesa/drivers/dri/i965/gen6_depth_state.c | 33 ++++++++++++++++++++++++++++
> >  2 files changed, 50 insertions(+)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
> > index eb865b9..3fc36aa 100644
> > --- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp
> > +++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
> > @@ -791,6 +791,23 @@ gen6_blorp_emit_depth_stencil_config(struct brw_context *brw,
> >     uint32_t draw_x = params->depth.x_offset;
> >     uint32_t draw_y = params->depth.y_offset;
> >     uint32_t tile_mask_x, tile_mask_y;
> > +   uint32_t surftype;
> > +   GLenum gl_target = params->depth.mt->target;
> > +
> > +   switch (gl_target) {
> > +   case GL_TEXTURE_CUBE_MAP_ARRAY:
> > +   case GL_TEXTURE_CUBE_MAP:
> > +      /* The PRM claims that we should use BRW_SURFACE_CUBE for this
> > +       * situation, but experiments show that gl_Layer doesn't work when we do
> > +       * this.  So we use BRW_SURFACE_2D, since for rendering purposes this is
> > +       * equivalent.
> > +       */
> > +      surftype = BRW_SURFACE_2D;
> > +      break;
> > +   default:
> > +      surftype = translate_tex_target(gl_target);
> > +      break;
> > +   }
> 
> Patches 5-7 look identical to the gen7 equivalent and hence in principle:
> 
> Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> 
> But having said that I think we need to start planning how to merge all the
> duplicate surface state logic between gen6-gen8. For example, the switch
> statement above can be now found twice per generation.

Agreed.  I'd like to see this work land - split Gen4-5/Gen6 out - then look at combining things in a better way.

Patches 5-7 are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140723/1c4c9b0d/attachment.sig>


More information about the mesa-dev mailing list