[Mesa-dev] [PATCH] mesa/st: Prefer RG_float when emulating INTENSITY Float over LA float
Gert Wollny
gw.fossdev at gmail.com
Mon Sep 10 10:18:23 UTC 2018
Am Freitag, den 07.09.2018, 17:57 -0400 schrieb Marek Olšák:
> RG can't be used to represent intensity, because RG uses swizzle
> RG01, while intensity uses RRRR.
I see, and thanks, I guess the mesa side then has to check these sizes
too, so I'll prepare a patch for this.
Best,
Gert
>
> Marek
>
> On Wed, Sep 5, 2018 at 4:36 AM, Gert Wollny <gw.fossdev at gmail.com>
> wrote:
> > From: Gert Wollny <gert.wollny at collabora.com>
> >
> > Gallium picked R16G16_FLOAT to represent GL_INTENSITY16F if no
> > intensity
> > format is provided by the driver. However, when calling
> >
> > glGetTexLevelParameteriv(..., GL_TEXTURE_INTENSITY_SIZE, ...)
> >
> > mesa will return a zero size because the actually used format has
> > no
> > intensity channel and as a fallback only the sizes of the red/green
> > channels are checked.
> >
> > Picking an RG format instead of the LA format resolves this
> > problem.
> >
> > Fixes (on virgl):
> > ext_framebuffer_multisample-fast-clear GL_ARB_texture_float *
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107832
> >
> > Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
> > ---
> > src/mesa/state_tracker/st_format.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/mesa/state_tracker/st_format.c
> > b/src/mesa/state_tracker/st_format.c
> > index 16a18c272d..b16ab9ea02 100644
> > --- a/src/mesa/state_tracker/st_format.c
> > +++ b/src/mesa/state_tracker/st_format.c
> > @@ -1448,9 +1448,9 @@ static const struct format_mapping
> > format_map[] = {
> > },
> > {
> > { GL_INTENSITY16F_ARB, 0 },
> > - { PIPE_FORMAT_I16_FLOAT, PIPE_FORMAT_L16A16_FLOAT,
> > + { PIPE_FORMAT_I16_FLOAT, PIPE_FORMAT_R16G16_FLOAT,
> > PIPE_FORMAT_I32_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT,
> > - PIPE_FORMAT_L32A32_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT,
> > 0 }
> > + PIPE_FORMAT_R32G32_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT,
> > 0 }
> > },
> > {
> > { GL_LUMINANCE16F_ARB, 0 },
> > @@ -1491,7 +1491,7 @@ static const struct format_mapping
> > format_map[] = {
> > },
> > {
> > { GL_INTENSITY32F_ARB, 0 },
> > - { PIPE_FORMAT_I32_FLOAT, PIPE_FORMAT_L32A32_FLOAT,
> > + { PIPE_FORMAT_I32_FLOAT, PIPE_FORMAT_R32G32_FLOAT,
> > PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
> > },
> > {
> > --
> > 2.16.4
> >
> > _______________________________________________
> > 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