Am 14.09.2014 16:07, schrieb mathias.froehl...@gmx.net: > From: Mathias Fröhlich <mathias.froehl...@gmx.net> > > Will be used in the implementation of NV_depth_buffer_float. > > Signed-off-by: Mathias Froehlich <mathias.froehl...@web.de > --- > src/mesa/main/glformats.c | 18 ++++++++++++++++++ > src/mesa/main/glformats.h | 3 +++ > 2 files changed, 21 insertions(+) > > diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c > index 00478f9..16f7d6b 100644 > --- a/src/mesa/main/glformats.c > +++ b/src/mesa/main/glformats.c > @@ -983,6 +983,24 @@ _mesa_is_depth_or_stencil_format(GLenum format) > > > /** > + * Test if the given image format is a float depth format. > + */ > +GLboolean > +_mesa_is_float_depth_format(GLenum format) > +{ > + switch (format) { > + case GL_DEPTH_COMPONENT32F: > + case GL_DEPTH_COMPONENT32F_NV: > + case GL_DEPTH32F_STENCIL8: > + case GL_DEPTH32F_STENCIL8_NV: > + return GL_TRUE; > + default: > + return GL_FALSE; > + } > +} > + > + > +/** > * Test if an image format is a supported compressed format. > * \param format the internal format token provided by the user. > * \return GL_TRUE if compressed, GL_FALSE if uncompressed > diff --git a/src/mesa/main/glformats.h b/src/mesa/main/glformats.h > index 7b03215..a960786 100644 > --- a/src/mesa/main/glformats.h > +++ b/src/mesa/main/glformats.h > @@ -93,6 +93,9 @@ extern GLboolean > _mesa_is_depth_or_stencil_format(GLenum format); > > extern GLboolean > +_mesa_is_float_depth_format(GLenum format); > + > +extern GLboolean > _mesa_is_compressed_format(struct gl_context *ctx, GLenum format); > > extern GLenum >
I'm amazed that the format enums are different. ARB_depth_buffer_float claims that's due to incompatible clamping behavior as per the revision history, but since the clamping behavior seems to be entirely controlled by the function entry points I don't see why that makes any sense. In any case the patches make sense to me but someone else should look at them. Roland _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev