static void
-bind_renderbuffer(GLenum target, GLuint renderbuffer, bool allow_user_names)
+bind_renderbuffer(GLenum target, GLuint renderbuffer)
{
struct gl_renderbuffer *newRb;
GET_CURRENT_CONTEXT(ctx);
/* ID was reserved, but no real renderbuffer object made yet */
newRb = NULL;
}
- else if (!newRb && !allow_user_names) {
+ else if (!newRb && ctx->API == API_OPENGL_CORE) {
/* All RB IDs must be Gen'd */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)");
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBindRenderbuffer(non-gen name)");
return;
}
void GLAPIENTRY
_mesa_BindRenderbuffer(GLenum target, GLuint renderbuffer)
{
- GET_CURRENT_CONTEXT(ctx);
-
/* OpenGL ES glBindRenderbuffer and glBindRenderbufferOES use this same
* entry point, but they allow the use of user-generated names.
*/
- bind_renderbuffer(target, renderbuffer, _mesa_is_gles(ctx));
+ bind_renderbuffer(target, renderbuffer);
}
void GLAPIENTRY
_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
{
- /* This function should not be in the dispatch table for core profile /
- * OpenGL 3.1, so execution should never get here in those cases -- no
- * need for an explicit test.
- */
- bind_renderbuffer(target, renderbuffer, true);
+ bind_renderbuffer(target, renderbuffer);
}
/**
if (!ctx->Extensions.MESA_framebuffer_flip_y)
goto invalid_pname_enum;
cannot_be_winsys_fbo = true;
+ break;
default:
goto invalid_pname_enum;
}
return _mesa_has_EXT_texture_snorm(ctx) || _mesa_has_EXT_render_snorm(ctx)
? GL_RG : 0;
case GL_RG_SNORM:
- _mesa_has_EXT_texture_snorm(ctx) ? GL_RG : 0;
+ return _mesa_has_EXT_texture_snorm(ctx) ? GL_RG : 0;
case GL_RG16_SNORM:
return _mesa_has_EXT_texture_snorm(ctx) ||
(_mesa_has_EXT_render_snorm(ctx) &&
static void
-bind_framebuffer(GLenum target, GLuint framebuffer, bool allow_user_names)
+bind_framebuffer(GLenum target, GLuint framebuffer)
{
struct gl_framebuffer *newDrawFb, *newReadFb;
GLboolean bindReadBuf, bindDrawBuf;
/* ID was reserved, but no real framebuffer object made yet */
newDrawFb = NULL;
}
- else if (!newDrawFb && !allow_user_names) {
+ else if (!newDrawFb && ctx->API == API_OPENGL_CORE) {
/* All FBO IDs must be Gen'd */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)");
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBindFramebuffer(non-gen name)");
return;
}
void GLAPIENTRY
_mesa_BindFramebuffer(GLenum target, GLuint framebuffer)
{
- GET_CURRENT_CONTEXT(ctx);
-
/* OpenGL ES glBindFramebuffer and glBindFramebufferOES use this same entry
* point, but they allow the use of user-generated names.
*/
- bind_framebuffer(target, framebuffer, _mesa_is_gles(ctx));
+ bind_framebuffer(target, framebuffer);
}
void GLAPIENTRY
_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
{
- /* This function should not be in the dispatch table for core profile /
- * OpenGL 3.1, so execution should never get here in those cases -- no
- * need for an explicit test.
- */
- bind_framebuffer(target, framebuffer, true);
+ bind_framebuffer(target, framebuffer);
}
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
return true;
case GL_TEXTURE_CUBE_MAP:
- /* 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.
+ /* GL_TEXTURE_CUBE_MAP is only allowed by OpenGL 4.5 here, which
+ * includes the DSA API.
+ *
+ * Because DSA is only enabled for GL 3.1+ and this can be called
+ * from _mesa_FramebufferTextureLayer in compatibility profile,
+ * we need to check the version.
*/
- return ctx->API == API_OPENGL_CORE;
+ return _mesa_is_desktop_gl(ctx) && ctx->Version >= 31;
}
_mesa_error(ctx, GL_INVALID_OPERATION,