summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.h
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2018-11-16 10:49:55 +0100
committerErik Faye-Lund <[email protected]>2018-12-03 18:16:44 +0100
commit74eab1c62fd37ca172b912f66add030043a59c92 (patch)
treeb661c218b3c20e8a5f1632db0b21b5cac4f1f336 /src/mesa/main/context.h
parentc4136ed5cc07a73c01d24a1c17ebe71e2690aef7 (diff)
mesa/main: split float-texture support checking in two
On OpenGL ES 2.0, there's separate extensions adding support for half-float and float textures. So we need to validate the enums separately as well. This also prevents these enums from incorrectly being allowed on OpenGL ES 1.x, where there's no extension that enables this in the first place. While we're at it, remove the pointless default-case, and the seemingly stale fallthrough comment. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/context.h')
-rw-r--r--src/mesa/main/context.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 071bd5b0818..cdda8cf2012 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -344,6 +344,20 @@ _mesa_has_integer_textures(const struct gl_context *ctx)
}
static inline bool
+_mesa_has_half_float_textures(const struct gl_context *ctx)
+{
+ return _mesa_has_ARB_texture_float(ctx) ||
+ _mesa_has_OES_texture_half_float(ctx) || _mesa_is_gles3(ctx);
+}
+
+static inline bool
+_mesa_has_float_textures(const struct gl_context *ctx)
+{
+ return _mesa_has_ARB_texture_float(ctx) ||
+ _mesa_has_OES_texture_float(ctx) || _mesa_is_gles3(ctx);
+ }
+
+static inline bool
_mesa_has_texture_rgb10_a2ui(const struct gl_context *ctx)
{
return _mesa_has_ARB_texture_rgb10_a2ui(ctx) || _mesa_is_gles3(ctx);