[Mesa-dev] [PATCH] isl: render target cube maps should be handled as 2D images, not cubes

Iago Toral itoral at igalia.com
Mon Jan 9 07:45:31 UTC 2017


On Fri, 2017-01-06 at 10:24 -0800, Jason Ekstrand wrote:
> On Jan 6, 2017 10:18, "Jason Ekstrand" <jason at jlekstrand.net> wrote:
> Thanks for catching this.  I wonder how I managed to switch the GL
> driver over to using ISL for emitting surface states without
> regressing anything...
> 
> Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
> 
> On Jan 6, 2017 05:42, "Iago Toral Quiroga" <itoral at igalia.com> wrote:
> > This fixes layered rendering Vulkan CTS tests with cube (arrays).
> > We
> > also do this in the GL driver, see this code from
> > gen8_depth_state.c
> > for example:
> > 
> > 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;
> >    depth *= 6;
> >    break;
> > 
> > So I guess we simply forgot to port this workaround to Vulkan.
> > 
> > Fixes:
> > dEQP-VK.geometry.layered.cube*
> > ---
> > 
> > With this (and the previous patch I sent to fix the SBE state
> > packet to not
> > skip the VUE header when we need the layer information) all the
> > layered
> > rendering tests in Vulkan CTS seem to pass.
> > 
> >  src/intel/isl/isl_surface_state.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/intel/isl/isl_surface_state.c
> > b/src/intel/isl/isl_surface_state.c
> > index 3bb0abd..0960a90 100644
> > --- a/src/intel/isl/isl_surface_state.c
> > +++ b/src/intel/isl/isl_surface_state.c
> > @@ -113,8 +113,9 @@ get_surftype(enum isl_surf_dim dim,
> > isl_surf_usage_flags_t usage)
> >        assert(!(usage & ISL_SURF_USAGE_CUBE_BIT));
> >        return SURFTYPE_1D;
> >     case ISL_SURF_DIM_2D:
> > -      if (usage & ISL_SURF_USAGE_STORAGE_BIT) {
> > -         /* Storage images are always plain 2-D, not cube */
> > +      if ((usage & ISL_SURF_USAGE_STORAGE_BIT) ||
> > +          (usage & ISL_SURF_USAGE_RENDER_TARGET_BIT)) {
> > +         /* Storage / Render images are always plain 2-D, not cube
> > */
> >           return SURFTYPE_2D;
> >        } else if (usage & ISL_SURF_USAGE_CUBE_BIT) {
> On second thought... I wonder if the right thing to do here wouldnt
> be to just change the other condition a bit to
> 
> if ((usage & ISL_SURF_USAGE_CUBE_BIT) &&
>     (usage & ISL_SURF_USAGE_TEXTURE_BIT)) {
>    /* We need SURFTYPE_CUBE to make cube sampling work */
>    return SURFTYPE_CUBE;
> } else {
>    /* Everything else (render and storage) treat cubes a plain 2D
> array textures */
>    return SURFTYPE_2D;
> }
> 
> It seems like textures, and not render targets, are the special case
> here.
Yep this seems to be a better way to look at it and Jenkins is happy
with it too, so I'll push this version.
Thanks!
> > 
> >           return SURFTYPE_CUBE;
> > 
> > --
> > 
> > 2.7.4
> > 

> > 
> > ______________________________> > _________________
> > 
> > mesa-dev mailing list
> > 
mesa-dev at lists.freedesktop.org
> > 
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > 

> 


> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170109/1f62eb41/attachment-0001.html>


More information about the mesa-dev mailing list