[Mesa-dev] [PATCH 03/30] intel/isl: Add a helper for determining if a color is 0/1
Jason Ekstrand
jason at jlekstrand.net
Tue Jun 6 00:41:50 UTC 2017
On Fri, Jun 2, 2017 at 1:09 PM, Chad Versace <chadversary at chromium.org>
wrote:
> On Fri 26 May 2017, Jason Ekstrand wrote:
> > ---
> > src/intel/isl/isl.c | 19 +++++++++++++++++++
> > src/intel/isl/isl.h | 4 ++++
> > 2 files changed, 23 insertions(+)
> >
> > diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> > index 321850e..4eec2fd 100644
> > --- a/src/intel/isl/isl.c
> > +++ b/src/intel/isl/isl.c
> > @@ -267,6 +267,25 @@ isl_tiling_get_info(const struct isl_device *dev,
> > return true;
> > }
> >
> > +bool
> > +isl_color_value_is_zero_one(union isl_color_value value,
> > + enum isl_format format)
> > +{
> > + if (isl_format_has_int_channel(format)) {
> > + for (unsigned i = 0; i < 4; i++) {
>
> This patch assumes the all four channels of isl_color_value are
> initialized, even if the isl_format has fewer than four channels.
> This smells like the seed of a hard-to-reproduce bug.
>
> Since it's not possible today to query the number of channels in an
> isl_format, please at least add a scary comment on the function about
> this.
>
Yeah... Turns out this patch isn't actually needed for anything. I'll just
drop it for now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170605/d1950ed9/attachment.html>
More information about the mesa-dev
mailing list