[Mesa-dev] [PATCH 1/2] mesa: Add color renderable/texture filterable format info for ES 3.x.

Kenneth Graunke kenneth at whitecape.org
Fri Mar 18 00:17:40 UTC 2016


On Thursday, March 17, 2016 5:04:28 PM PDT Jordan Justen wrote:
> On 2016-03-16 20:32:18, Kenneth Graunke wrote:
> > OpenGL ES 3.x contains a table of sized internal formats and their
> > required properties.  In particular, each format is marked as
> > "Color Renderable" or "Texture Filterable".
> > 
> > This patch introduces two functions that can be used to query the
> > information from that table.
> > 
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> >  src/mesa/main/glformats.c | 83 ++++++++++++++++++++++++++++++++++++++++++
+++++
> >  src/mesa/main/glformats.h |  7 ++++
> >  2 files changed, 90 insertions(+)
> > 
> > diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> > index cf64958..96ab393 100644
> > --- a/src/mesa/main/glformats.c
> > +++ b/src/mesa/main/glformats.c
> > @@ -3556,3 +3556,86 @@ _mesa_format_from_format_and_type(GLenum format, 
GLenum type)
> >      */
> >     unreachable("Unsupported format");
> >  }
> > +
> > +/**
> > + * Returns true if \p internal_format is a sized internal format that
> > + * is marked "Color Renderable" in Table 8.10 of the ES 3.2 
specification.
> > + */
> > +bool
> > +_mesa_is_es3_color_renderable(GLenum internal_format)
> > +{
> > +   switch (internal_format) {
> > +   case GL_R8:
> > +   case GL_RG8:
> > +   case GL_RGB8:
> > +   case GL_RGB565:
> > +   case GL_RGBA4:
> > +   case GL_RGB5_A1:
> > +   case GL_RGBA8:
> > +   case GL_RGB10_A2:
> > +   case GL_RGB10_A2UI:
> > +   case GL_SRGB8_ALPHA8:
> 
> > +   case GL_R16F:
> > +   case GL_RG16F:
> > +   case GL_RGBA16F:
> > +   case GL_R32F:
> > +   case GL_RG32F:
> > +   case GL_RGBA32F:
> > +   case GL_R11F_G11F_B10F:
> 
> I don't expect that it makes a difference, but I noticed that ES 3.0
> doesn't require these 7.
> 
> Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

Right.  I think some of them get added with various OES extensions that
we support.  I decided just to go for the latest spec and not bother
trying to hunt down all the extensions.

Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160317/cfefa741/attachment.sig>


More information about the mesa-dev mailing list