summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/glformats.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-07-07 11:50:44 -0700
committerKenneth Graunke <[email protected]>2016-07-08 01:26:23 -0700
commitb3c5df3ca4ca69006114565bf5d6d01c7b8b2934 (patch)
treeb89a6cdfd5f4e808accb572af4d9d95a9a521178 /src/mesa/main/glformats.c
parentb7be23b6e16c31293010dd926db82720a4954cf5 (diff)
mesa: Mark R*32F formats as filterable when an extension is present.
GL_OES_texture_float_linear marks R32F, RG32F, RGB32F, and RGBA32F as texture filterable. Fixes glGenerateMipmap GL errors when visiting a WebGL demo in Chromium: http://www.iamnop.com/particles Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/main/glformats.c')
-rw-r--r--src/mesa/main/glformats.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 24ce7b04f6b..448577e059f 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -3656,7 +3656,8 @@ _mesa_is_es3_color_renderable(GLenum internal_format)
* is marked "Texture Filterable" in Table 8.10 of the ES 3.2 specification.
*/
bool
-_mesa_is_es3_texture_filterable(GLenum internal_format)
+_mesa_is_es3_texture_filterable(const struct gl_context *ctx,
+ GLenum internal_format)
{
switch (internal_format) {
case GL_R8:
@@ -3680,6 +3681,20 @@ _mesa_is_es3_texture_filterable(GLenum internal_format)
case GL_R11F_G11F_B10F:
case GL_RGB9_E5:
return true;
+ case GL_R32F:
+ case GL_RG32F:
+ case GL_RGB32F:
+ case GL_RGBA32F:
+ /* The OES_texture_float_linear spec says:
+ *
+ * "When implemented against OpenGL ES 3.0 or later versions, sized
+ * 32-bit floating-point formats become texture-filterable. This
+ * should be noted by, for example, checking the ``TF'' column of
+ * table 8.13 in the ES 3.1 Specification (``Correspondence of sized
+ * internal formats to base internal formats ... and use cases ...'')
+ * for the R32F, RG32F, RGB32F, and RGBA32F formats."
+ */
+ return ctx->Extensions.OES_texture_float_linear;
default:
return false;
}