summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formatquery.c
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2016-09-03 14:31:44 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2016-09-06 22:45:44 -0400
commitc42acd93d47452eec492400d1f3e7c66dd9bb672 (patch)
treef6fd929233ac0998462f89afbb20077af964c38e /src/mesa/main/formatquery.c
parentf654b4983a8411ada20258f8095b3bc5543914c1 (diff)
downloadexternal_mesa3d-c42acd93d47452eec492400d1f3e7c66dd9bb672.zip
external_mesa3d-c42acd93d47452eec492400d1f3e7c66dd9bb672.tar.gz
external_mesa3d-c42acd93d47452eec492400d1f3e7c66dd9bb672.tar.bz2
mesa/formatquery: limit ES target support, fix core context support
First off, as late as ES 3.2, GetInternalformat only supports RENDERBUFFER and 2DMS(_ARRAY) targets. Secondly, the _mesa_has_ext helpers are very accurate... a little too accurate, some might say. If we only show an extension in compat profiles because core profiles have the functionality guaranteed, they will return false. Fix these to either check for a core profile explicitly, or to a different-but-identical extension available in core profile. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Matteo Bruni <matteo.mystral@gmail.com> Tested-by: Matteo Bruni <matteo.mystral@gmail.com> Cc: mesa-stable@lists.freedesktop.org
Diffstat (limited to 'src/mesa/main/formatquery.c')
-rw-r--r--src/mesa/main/formatquery.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index ad3ae56..29df958 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -387,13 +387,13 @@ _is_target_supported(struct gl_context *ctx, GLenum target)
* "if a particular type of <target> is not supported by the
* implementation the "unsupported" answer should be given.
* This is not an error."
+ *
+ * For OpenGL ES, queries can only be used with GL_RENDERBUFFER or MS.
*/
switch(target){
+ case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
case GL_TEXTURE_3D:
- break;
-
- case GL_TEXTURE_1D:
if (!_mesa_is_desktop_gl(ctx))
return false;
break;
@@ -404,12 +404,12 @@ _is_target_supported(struct gl_context *ctx, GLenum target)
break;
case GL_TEXTURE_2D_ARRAY:
- if (!(_mesa_has_EXT_texture_array(ctx) || _mesa_is_gles3(ctx)))
+ if (!_mesa_has_EXT_texture_array(ctx))
return false;
break;
case GL_TEXTURE_CUBE_MAP:
- if (!_mesa_has_ARB_texture_cube_map(ctx))
+ if (ctx->API != API_OPENGL_CORE && !_mesa_has_ARB_texture_cube_map(ctx))
return false;
break;
@@ -419,7 +419,7 @@ _is_target_supported(struct gl_context *ctx, GLenum target)
break;
case GL_TEXTURE_RECTANGLE:
- if (!_mesa_has_NV_texture_rectangle(ctx))
+ if (!_mesa_has_ARB_texture_rectangle(ctx))
return false;
break;
@@ -968,7 +968,8 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
switch (pname) {
case GL_INTERNALFORMAT_DEPTH_SIZE:
- if (!_mesa_has_ARB_depth_texture(ctx) &&
+ if (ctx->API != API_OPENGL_CORE &&
+ !_mesa_has_ARB_depth_texture(ctx) &&
target != GL_RENDERBUFFER &&
target != GL_TEXTURE_BUFFER)
goto end;