[Mesa-dev] [PATCH] anv/formats: Return proper error code for unsupported formats

Nanley Chery nanleychery at gmail.com
Wed Apr 27 16:53:09 UTC 2016


On Tue, Apr 26, 2016 at 06:16:12PM -0700, Jason Ekstrand wrote:
> Good catch!
> 
> Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
> 
> Why does it cause an assert?
> 

Thanks! The test does math on the returned properties struct if the
format query is successful. One of the functions, deLog2Ceil32(),
asserts that properties.maxExtent.width is greater than 0. Since we
returned a zeroed struct for unsupported formats coupled with a
success status, we've been managing to trip up the test.

- Nanley

> On Tue, Apr 26, 2016 at 3:35 PM, Nanley Chery <nanleychery at gmail.com> wrote:
> 
> > From: Nanley Chery <nanley.g.chery at intel.com>
> >
> > Fixes some failures in dEQP-VK.api.info.image_format_properties.* and
> > enables the test group to execute without assert failing.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94896
> > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > ---
> >  src/intel/vulkan/anv_formats.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/intel/vulkan/anv_formats.c
> > b/src/intel/vulkan/anv_formats.c
> > index 750af79..395f917 100644
> > --- a/src/intel/vulkan/anv_formats.c
> > +++ b/src/intel/vulkan/anv_formats.c
> > @@ -583,7 +583,7 @@ unsupported:
> >        .maxResourceSize = 0,
> >     };
> >
> > -   return VK_SUCCESS;
> > +   return VK_ERROR_FORMAT_NOT_SUPPORTED;
> >  }
> >
> >  void anv_GetPhysicalDeviceSparseImageFormatProperties(
> > --
> > 2.8.0
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >


More information about the mesa-dev mailing list