diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2015-05-20 17:19:29 -0700 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-06-03 16:32:14 +0100 |
commit | 828eeb65dc8ccff90bb6af6d29d86df391ba6e3e (patch) | |
tree | cfff0f9f0e97432d0f9685d88bb2175a20740715 | |
parent | 74e7328281dbdfcdaa86057c3dcdcc6bf387f92a (diff) |
mesa: Use the profile instead of an extension bit to validate GL_TEXTURE_CUBE_MAP
The extension on which this depends will always be enabled in core
profile, and the extension bit is about to be removed.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Cc: "10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 832ea2345a96388950bb39ce8a2e4ca8bfdb4fe5)
-rw-r--r-- | src/mesa/main/fbobject.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 5b8c52ab2a..c5a702636a 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -2707,6 +2707,10 @@ check_texture_target(struct gl_context *ctx, GLenum target, /* We're being called by glFramebufferTextureLayer(). * The only legal texture types for that function are 3D, * cube-map, and 1D/2D/cube-map array textures. + * + * We don't need to check for GL_ARB_texture_cube_map_array because the + * application wouldn't have been able to create a texture with a + * GL_TEXTURE_CUBE_MAP_ARRAY target if the extension were not enabled. */ switch (target) { case GL_TEXTURE_3D: @@ -2716,10 +2720,13 @@ check_texture_target(struct gl_context *ctx, GLenum target, case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: return true; case GL_TEXTURE_CUBE_MAP: - /* This target is valid in TextureLayer when ARB_direct_state_access - * or OpenGL 4.5 is supported. + /* We don't need to check the extension (GL_ARB_direct_state_access) or + * GL version (4.5) for GL_TEXTURE_CUBE_MAP because DSA is always + * enabled in core profile. This can be called from + * _mesa_FramebufferTextureLayer in compatibility profile (OpenGL 3.0), + * so we do have to check the profile. */ - return ctx->Extensions.ARB_direct_state_access; + return ctx->API == API_OPENGL_CORE; } _mesa_error(ctx, GL_INVALID_OPERATION, |