[Mesa-dev] [PATCH 5/5] i965 gen7: use SURFACE_STATE fields to select render level/layer

Paul Berry stereotype441 at gmail.com
Fri May 24 14:17:11 PDT 2013


On 22 May 2013 20:00, Jordan Justen <jljusten at gmail.com> wrote:

> On Wed, May 22, 2013 at 3:56 PM, Eric Anholt <eric at anholt.net> wrote:
> > Jordan Justen <jordan.l.justen at intel.com> writes:
> >> -   surf[0] = BRW_SURFACE_2D << BRW_SURFACE_TYPE_SHIFT |
> >> +   switch (gl_target) {
> >> +   case GL_TEXTURE_CUBE_MAP_ARRAY:
> >> +   case GL_TEXTURE_CUBE_MAP:
> >> +      surftype = BRW_SURFACE_2D;
> >> +      is_array = true;
> >> +      depth *= 6;
> >> +      break;
> >> +   default:
> >> +      surftype = translate_tex_target(gl_target);
> >> +      is_array = _mesa_tex_target_is_array(gl_target);
> >> +      break;
> >> +   }
> >
> > Why the conversion of cubes to arrays?  It looks from mentions in the
> > "render target write" message section's mention of RTAI that cubes are
> > supported.
>
> Hmm. Good catch.
>
> I think I started implementing this in brw_wm_surface_state.c, so I
> was looking at what would be needed for the older gens. It looks like
> pre-gen6, that cube-arrays were not supported in the surface_state.
> I'm not sure right now why I extended that to include converting
> non-array cubes to 2d-arrays as well.
>
> Anyway, I'll investigate cleaning this up for gen7, since that is what
> we are starting with.
>

When Jordan was first working on this feature, he asked me to help debug
it, and I found by reading simulator source code that SURFACE_STATE's
"minimum array element" field is ignored for cube surfaces (in direct
contradiction to the hw docs).  Fortunately, treating the surface as an
array is an effective workaround, since for render targets there is
effectively no difference between a cube map and an ordinary array with a
6x higher depth.



>
> Thanks,
>
> -Jordan
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130524/468fe951/attachment.html>


More information about the mesa-dev mailing list