Re: [Mesa-dev] [PATCH 2/3] st/mesa: enable GL_EXT_float_blend when possible

2019-02-13 Thread Erik Faye-Lund
Reviewed-by: Erik Faye-Lund 

And just for the record, I think this is the right "compromise" between
checking all possible formats and facilitating fallbacks.

On Tue, 2019-02-12 at 22:40 -0500, Ilia Mirkin wrote:
> If the driver supports PIPE_BIND_BLENABLE on RGBA32F, flip
> EXT_float_blend on (which will affect ES3 contexts).
> 
> Signed-off-by: Ilia Mirkin 
> ---
>  src/mesa/state_tracker/st_extensions.c | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/mesa/state_tracker/st_extensions.c
> b/src/mesa/state_tracker/st_extensions.c
> index d2660099fc1..528e6b74a54 100644
> --- a/src/mesa/state_tracker/st_extensions.c
> +++ b/src/mesa/state_tracker/st_extensions.c
> @@ -820,6 +820,12 @@ void st_init_extensions(struct pipe_screen
> *screen,
>PIPE_FORMAT_R16G16B16A16_SNORM } },
> };
>  
> +   /* Required: render target, sampler, and blending */
> +   static const struct st_extension_format_mapping rt_blendable[] =
> {
> +  { { o(EXT_float_blend) },
> +{ PIPE_FORMAT_R32G32B32A32_FLOAT } },
> +   };
> +
> /* Required: depth stencil and sampler support */
> static const struct st_extension_format_mapping
> depthstencil_mapping[] = {
>{ { o(ARB_depth_buffer_float) },
> @@ -1025,6 +1031,10 @@ void st_init_extensions(struct pipe_screen
> *screen,
> init_format_extensions(screen, extensions, rendertarget_mapping,
>ARRAY_SIZE(rendertarget_mapping),
> PIPE_TEXTURE_2D,
>PIPE_BIND_RENDER_TARGET |
> PIPE_BIND_SAMPLER_VIEW);
> +   init_format_extensions(screen, extensions, rt_blendable,
> +  ARRAY_SIZE(rt_blendable), PIPE_TEXTURE_2D,
> +  PIPE_BIND_RENDER_TARGET |
> PIPE_BIND_SAMPLER_VIEW |
> +  PIPE_BIND_BLENDABLE);
> init_format_extensions(screen, extensions, depthstencil_mapping,
>ARRAY_SIZE(depthstencil_mapping),
> PIPE_TEXTURE_2D,
>PIPE_BIND_DEPTH_STENCIL |
> PIPE_BIND_SAMPLER_VIEW);

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 2/3] st/mesa: enable GL_EXT_float_blend when possible

2019-02-12 Thread Ilia Mirkin
On Tue, Feb 12, 2019 at 11:13 PM Jason Ekstrand  wrote:
>
> On February 12, 2019 21:40:49 Ilia Mirkin  wrote:
>
> > If the driver supports PIPE_BIND_BLENABLE on RGBA32F, flip
> > EXT_float_blend on (which will affect ES3 contexts).
> >
> > Signed-off-by: Ilia Mirkin 
> > ---
> > src/mesa/state_tracker/st_extensions.c | 10 ++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/src/mesa/state_tracker/st_extensions.c
> > b/src/mesa/state_tracker/st_extensions.c
> > index d2660099fc1..528e6b74a54 100644
> > --- a/src/mesa/state_tracker/st_extensions.c
> > +++ b/src/mesa/state_tracker/st_extensions.c
> > @@ -820,6 +820,12 @@ void st_init_extensions(struct pipe_screen *screen,
> >   PIPE_FORMAT_R16G16B16A16_SNORM } },
> >};
> >
> > +   /* Required: render target, sampler, and blending */
> > +   static const struct st_extension_format_mapping rt_blendable[] = {
> > +  { { o(EXT_float_blend) },
> > +{ PIPE_FORMAT_R32G32B32A32_FLOAT } },
>
> Any particular reason you're only checking the one format? Seems like it
> should check R and RG too.
>
> With that resolved, the series is
>
> Reviewed-by: Jason Ekstrand 
>
> But take that with a huge grain of salt. I haven't implemented an OpenGL
> extension in 4 years so it'd be good to get another sanity check.


Well, it's a bit tricky. I guess you could have a weird driver, but
it's hard to check for every possibility.

I don't want to just start checking for e.g. R32_FLOAT, since a driver
might not support that at all, in which case we'd fall back to
RGBA32_FLOAT. The assumption is that if you support blending for
RGBA32_FLOAT, then you either support both blending + rendering or
neither on the other 32_FLOAT variants.

These checks aren't designed to handle EVERY possible driver-reported
permutation -- I think this is a reasonable compromise.

  -ilia
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 2/3] st/mesa: enable GL_EXT_float_blend when possible

2019-02-12 Thread Jason Ekstrand

On February 12, 2019 21:40:49 Ilia Mirkin  wrote:


If the driver supports PIPE_BIND_BLENABLE on RGBA32F, flip
EXT_float_blend on (which will affect ES3 contexts).

Signed-off-by: Ilia Mirkin 
---
src/mesa/state_tracker/st_extensions.c | 10 ++
1 file changed, 10 insertions(+)

diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c

index d2660099fc1..528e6b74a54 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -820,6 +820,12 @@ void st_init_extensions(struct pipe_screen *screen,
  PIPE_FORMAT_R16G16B16A16_SNORM } },
   };

+   /* Required: render target, sampler, and blending */
+   static const struct st_extension_format_mapping rt_blendable[] = {
+  { { o(EXT_float_blend) },
+{ PIPE_FORMAT_R32G32B32A32_FLOAT } },


Any particular reason you're only checking the one format? Seems like it 
should check R and RG too.


With that resolved, the series is

Reviewed-by: Jason Ekstrand 

But take that with a huge grain of salt. I haven't implemented an OpenGL 
extension in 4 years so it'd be good to get another sanity check. 


--Jason


+   };
+
   /* Required: depth stencil and sampler support */
   static const struct st_extension_format_mapping depthstencil_mapping[] = {
  { { o(ARB_depth_buffer_float) },
@@ -1025,6 +1031,10 @@ void st_init_extensions(struct pipe_screen *screen,
   init_format_extensions(screen, extensions, rendertarget_mapping,
  ARRAY_SIZE(rendertarget_mapping), PIPE_TEXTURE_2D,
  PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW);
+   init_format_extensions(screen, extensions, rt_blendable,
+  ARRAY_SIZE(rt_blendable), PIPE_TEXTURE_2D,
+  PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW |
+  PIPE_BIND_BLENDABLE);
   init_format_extensions(screen, extensions, depthstencil_mapping,
  ARRAY_SIZE(depthstencil_mapping), PIPE_TEXTURE_2D,
  PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_SAMPLER_VIEW);
--
2.19.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev




___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 2/3] st/mesa: enable GL_EXT_float_blend when possible

2019-02-12 Thread Ilia Mirkin
If the driver supports PIPE_BIND_BLENABLE on RGBA32F, flip
EXT_float_blend on (which will affect ES3 contexts).

Signed-off-by: Ilia Mirkin 
---
 src/mesa/state_tracker/st_extensions.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index d2660099fc1..528e6b74a54 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -820,6 +820,12 @@ void st_init_extensions(struct pipe_screen *screen,
   PIPE_FORMAT_R16G16B16A16_SNORM } },
};
 
+   /* Required: render target, sampler, and blending */
+   static const struct st_extension_format_mapping rt_blendable[] = {
+  { { o(EXT_float_blend) },
+{ PIPE_FORMAT_R32G32B32A32_FLOAT } },
+   };
+
/* Required: depth stencil and sampler support */
static const struct st_extension_format_mapping depthstencil_mapping[] = {
   { { o(ARB_depth_buffer_float) },
@@ -1025,6 +1031,10 @@ void st_init_extensions(struct pipe_screen *screen,
init_format_extensions(screen, extensions, rendertarget_mapping,
   ARRAY_SIZE(rendertarget_mapping), PIPE_TEXTURE_2D,
   PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW);
+   init_format_extensions(screen, extensions, rt_blendable,
+  ARRAY_SIZE(rt_blendable), PIPE_TEXTURE_2D,
+  PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW |
+  PIPE_BIND_BLENDABLE);
init_format_extensions(screen, extensions, depthstencil_mapping,
   ARRAY_SIZE(depthstencil_mapping), PIPE_TEXTURE_2D,
   PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_SAMPLER_VIEW);
-- 
2.19.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev