summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-09-08 14:20:17 +1000
committerTimothy Arceri <[email protected]>2018-09-18 19:58:24 +1000
commitb54a2311a904161f31bd529ec1c816d51fac2095 (patch)
treea44b69f2f14e2e9054b17917dbba7749f53e95aa /src/mesa/main/fbobject.c
parent02843ed76868c7e6268a028bb18ea5e48b72e291 (diff)
mesa: enable EXT_framebuffer_object in core profile
Since user defined names are not allowed in core profile we remove the allow_user_names bool and just check if we have a core profile like all other buffer/texture object handling code does. This extension is required by "Wolfenstein: The Old Blood" and is exposed in core in the Nvidia binary driver. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 3263fce845e..c3dded6b928 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1410,7 +1410,7 @@ allocate_renderbuffer_locked(struct gl_context *ctx, GLuint renderbuffer,
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);
@@ -1430,9 +1430,10 @@ bind_renderbuffer(GLenum target, GLuint renderbuffer, bool allow_user_names)
/* 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;
}
@@ -1455,22 +1456,16 @@ bind_renderbuffer(GLenum target, GLuint renderbuffer, bool allow_user_names)
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);
}
/**
@@ -2798,7 +2793,7 @@ check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
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;
@@ -2829,9 +2824,10 @@ bind_framebuffer(GLenum target, GLuint framebuffer, bool allow_user_names)
/* 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;
}
@@ -2920,23 +2916,17 @@ _mesa_bind_framebuffers(struct gl_context *ctx,
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);
}