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

Jordan Justen jljusten at gmail.com
Fri May 24 18:39:27 PDT 2013


On Fri, May 24, 2013 at 2:17 PM, Paul Berry <stereotype441 at gmail.com> wrote:
> 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.

I guess I forgot this discussion of ours. I spent some time trying to
get BRW_SURFACE_CUBE working (again, I suppose), with no luck.

Anyway...

Either of you good for an r-b on this second version of patch 5 in
this series then?

-Jordan


More information about the mesa-dev mailing list