return _mesa_has_EXT_texture_integer(ctx) || _mesa_is_gles3(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 GL_YCBCR_MESA;
}
- if (ctx->Extensions.ARB_texture_float) {
+ if (_mesa_has_half_float_textures(ctx)) {
switch (internalFormat) {
case GL_ALPHA16F_ARB:
- case GL_ALPHA32F_ARB:
return GL_ALPHA;
case GL_RGBA16F_ARB:
- case GL_RGBA32F_ARB:
return GL_RGBA;
case GL_RGB16F_ARB:
- case GL_RGB32F_ARB:
return GL_RGB;
case GL_INTENSITY16F_ARB:
- case GL_INTENSITY32F_ARB:
return GL_INTENSITY;
case GL_LUMINANCE16F_ARB:
- case GL_LUMINANCE32F_ARB:
return GL_LUMINANCE;
case GL_LUMINANCE_ALPHA16F_ARB:
+ return GL_LUMINANCE_ALPHA;
+ }
+ }
+
+ if (_mesa_has_float_textures(ctx)) {
+ switch (internalFormat) {
+ case GL_ALPHA32F_ARB:
+ return GL_ALPHA;
+ case GL_RGBA32F_ARB:
+ return GL_RGBA;
+ case GL_RGB32F_ARB:
+ return GL_RGB;
+ case GL_INTENSITY32F_ARB:
+ return GL_INTENSITY;
+ case GL_LUMINANCE32F_ARB:
+ return GL_LUMINANCE;
case GL_LUMINANCE_ALPHA32F_ARB:
return GL_LUMINANCE_ALPHA;
- default:
- ; /* fallthrough */
}
}
if (_mesa_has_rg_textures(ctx)) {
switch (internalFormat) {
case GL_R16F:
+ if (!_mesa_has_half_float_textures(ctx))
+ break;
+ return GL_RED;
case GL_R32F:
- if (!ctx->Extensions.ARB_texture_float)
- break;
+ if (!_mesa_has_float_textures(ctx))
+ break;
return GL_RED;
case GL_R8I:
case GL_R8UI:
return GL_RED;
case GL_RG16F:
+ if (!_mesa_has_half_float_textures(ctx))
+ break;
+ return GL_RG;
case GL_RG32F:
- if (!ctx->Extensions.ARB_texture_float)
- break;
+ if (!_mesa_has_float_textures(ctx))
+ break;
return GL_RG;
case GL_RG8I:
case GL_RG8UI: