diff options
author | marha <marha@users.sourceforge.net> | 2013-02-27 10:45:05 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-02-27 10:45:05 +0100 |
commit | c74ef795c7282681616decc36a9a81cd1b1b6ec7 (patch) | |
tree | beb5f13ba78bd7920eae918b6aa5db5bac83f0da /mesalib/src/mesa/main/fbobject.c | |
parent | f51268259621a21d14e40b8a41c5803a5c2ce706 (diff) | |
download | vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.tar.gz vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.tar.bz2 vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.zip |
libX11 mesa pixman xkeyboard-config
xkeyboard-config commit 9993f996e75232385b19cc5078f7fecde6b399b9
libX11 commit b687440c28c7da6ee0ae44514d20248db5161606
pixman commit 2156fb51b353867d5a18b734690ca551f74d4fb1
mesa commit f987d23b28491bd7b0552bd9daffa53a8e073c71
Diffstat (limited to 'mesalib/src/mesa/main/fbobject.c')
-rw-r--r-- | mesalib/src/mesa/main/fbobject.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 257f839a6..89bc57509 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -3310,3 +3310,56 @@ _mesa_InvalidateFramebuffer(GLenum target, GLsizei numAttachments, 0, 0, MAX_VIEWPORT_WIDTH, MAX_VIEWPORT_HEIGHT, "glInvalidateFramebuffer"); } + +void GLAPIENTRY +_mesa_DiscardFramebufferEXT(GLenum target, GLsizei numAttachments, + const GLenum *attachments) +{ + struct gl_framebuffer *fb; + GLint i; + + GET_CURRENT_CONTEXT(ctx); + + fb = get_framebuffer_target(ctx, target); + if (!fb) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glDiscardFramebufferEXT(target %s)", + _mesa_lookup_enum_by_nr(target)); + return; + } + + if (numAttachments < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glDiscardFramebufferEXT(numAttachments < 0)"); + return; + } + + for (i = 0; i < numAttachments; i++) { + switch (attachments[i]) { + case GL_COLOR: + case GL_DEPTH: + case GL_STENCIL: + if (_mesa_is_user_fbo(fb)) + goto invalid_enum; + break; + case GL_COLOR_ATTACHMENT0: + case GL_DEPTH_ATTACHMENT: + case GL_STENCIL_ATTACHMENT: + if (_mesa_is_winsys_fbo(fb)) + goto invalid_enum; + break; + default: + goto invalid_enum; + } + } + + if (ctx->Driver.DiscardFramebuffer) + ctx->Driver.DiscardFramebuffer(ctx, target, numAttachments, attachments); + + return; + +invalid_enum: + _mesa_error(ctx, GL_INVALID_ENUM, + "glDiscardFramebufferEXT(attachment %s)", + _mesa_lookup_enum_by_nr(attachments[i])); +} |