diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/dd.h | 2 | ||||
-rw-r--r-- | src/mesa/main/fbobject.c | 13 | ||||
-rw-r--r-- | src/mesa/main/fbobject.h | 3 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 0df8cfa5b5d..6af304fe26a 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -801,6 +801,8 @@ struct dd_function_table { /*@{*/ struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name); struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name); + void (*BindFramebuffer)(GLcontext *ctx, GLenum target, + struct gl_framebuffer *fb); void (*FramebufferRenderbuffer)(GLcontext *ctx, struct gl_framebuffer *fb, GLenum attachment, diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 749115a799d..8c428f8a259 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -653,11 +653,14 @@ _mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) /** * Given an internal format token for a render buffer, return the * corresponding base format. + * This is very similar to _mesa_base_tex_format() but the set of valid + * internal formats is somewhat different. + * * \return one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT * GL_DEPTH_STENCIL_EXT or zero if error. */ -static GLenum -base_internal_format(GLcontext *ctx, GLenum internalFormat) +GLenum +_mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat) { switch (internalFormat) { case GL_RGB: @@ -717,7 +720,7 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, return; } - baseFormat = base_internal_format(ctx, internalFormat); + baseFormat = _mesa_base_fbo_format(ctx, internalFormat); if (baseFormat == 0) { _mesa_error(ctx, GL_INVALID_ENUM, "glRenderbufferStorageEXT(internalFormat)"); @@ -973,6 +976,10 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } ctx->DrawBuffer = newFb; } + + if (ctx->Driver.BindFramebuffer) { + ctx->Driver.BindFramebuffer(ctx, target, newFb); + } } diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index 71517adfd89..3171aa7b1b9 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -54,6 +54,9 @@ _mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, extern void _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb); +extern GLenum +_mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat); + extern GLboolean GLAPIENTRY _mesa_IsRenderbufferEXT(GLuint renderbuffer); |