[Mesa-dev] [PATCH] radv/gfx10: fix intensity formats by setting ALPHA_IS_ON_MSB

Marek Olšák maraeo at gmail.com
Wed Jul 24 19:05:38 UTC 2019


On Wed, Jul 24, 2019 at 9:18 AM Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
wrote:

> On Wed, Jul 24, 2019 at 3:00 PM Samuel Pitoiset
> <samuel.pitoiset at gmail.com> wrote:
> >
> > This fixes
> > dEQP-VK.rasterization.primitive_size.points.point_size_*
> >
> > This also fixes some black squares with the Sascha SSAO demo.
> >
> > Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> > ---
> >  src/amd/vulkan/radv_image.c | 15 ++++++++++++++-
> >  1 file changed, 14 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
> > index 09413333cbb..59d6d0ced78 100644
> > --- a/src/amd/vulkan/radv_image.c
> > +++ b/src/amd/vulkan/radv_image.c
> > @@ -617,6 +617,19 @@ static unsigned gfx9_border_color_swizzle(const
> enum vk_swizzle swizzle[4])
> >         return bc_swizzle;
> >  }
> >
> > +static bool vi_alpha_is_on_msb(struct radv_device *device, VkFormat
> format)
> > +{
> > +       const struct vk_format_description *desc =
> vk_format_description(format);
> > +
> > +       /* Formats with 3 channels can't have alpha. */
> > +       if (desc->nr_channels == 3)
> > +               return true; /* same as xxxA; is any value OK here? */
>
> I don't think this is correct. For formats with multiple channels,
> this bit is not about "does this format have alpha", but "is the alpha
> channel on MSB or LSB". IIRC even for RG the "alpha" is just the G
> component, no explicit alpha needed.
>

Invalid example. RG has 2 channels. The code is for 3 channels. All 3
channel formats don't have an alpha channel, and therefore the clear alpha
value doesn't matter.

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190724/f4f7742b/attachment.html>


More information about the mesa-dev mailing list