diff options
author | marha <marha@users.sourceforge.net> | 2012-07-31 10:17:14 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-07-31 10:17:14 +0200 |
commit | 83da3ad0287bc51cd16ee6911fe73dc98ebe000b (patch) | |
tree | 48d48590a0b0a3770006aeda8ec2b2a45054d1f1 /mesalib/src/mesa/main/framebuffer.c | |
parent | 00e30605ffc7ac3cf1a091ff2c1f46cfefb780d7 (diff) | |
parent | bd27b3d008b0abf9ae2edcb127302728808533e4 (diff) | |
download | vcxsrv-83da3ad0287bc51cd16ee6911fe73dc98ebe000b.tar.gz vcxsrv-83da3ad0287bc51cd16ee6911fe73dc98ebe000b.tar.bz2 vcxsrv-83da3ad0287bc51cd16ee6911fe73dc98ebe000b.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/framebuffer.c')
-rw-r--r-- | mesalib/src/mesa/main/framebuffer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/framebuffer.c b/mesalib/src/mesa/main/framebuffer.c index ea14148de..13887f8f5 100644 --- a/mesalib/src/mesa/main/framebuffer.c +++ b/mesalib/src/mesa/main/framebuffer.c @@ -347,7 +347,7 @@ _mesa_resizebuffers( struct gl_context *ctx ) GLuint newWidth, newHeight; struct gl_framebuffer *buffer = ctx->WinSysDrawBuffer; - assert(buffer->Name == 0); + assert(_mesa_is_winsys_fbo(buffer)); /* ask device driver for size of output buffer */ ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); @@ -364,7 +364,7 @@ _mesa_resizebuffers( struct gl_context *ctx ) GLuint newWidth, newHeight; struct gl_framebuffer *buffer = ctx->WinSysReadBuffer; - assert(buffer->Name == 0); + assert(_mesa_is_winsys_fbo(buffer)); /* ask device driver for size of read buffer */ ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); @@ -444,7 +444,7 @@ _mesa_update_draw_buffer_bounds(struct gl_context *ctx) if (!buffer) return; - if (buffer->Name) { + if (_mesa_is_user_fbo(buffer)) { /* user-created framebuffer size depends on the renderbuffers */ update_framebuffer_size(ctx, buffer); } @@ -517,6 +517,13 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx, const GLenum baseFormat = _mesa_get_format_base_format(rb->Format); const gl_format fmt = rb->Format; + /* Grab samples and sampleBuffers from any attachment point (assuming + * the framebuffer is complete, we'll get the same answer from all + * attachments). + */ + fb->Visual.samples = rb->NumSamples; + fb->Visual.sampleBuffers = rb->NumSamples > 0 ? 1 : 0; + if (_mesa_is_legal_color_format(ctx, baseFormat)) { fb->Visual.redBits = _mesa_get_format_bits(fmt, GL_RED_BITS); fb->Visual.greenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS); @@ -524,8 +531,6 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx, fb->Visual.alphaBits = _mesa_get_format_bits(fmt, GL_ALPHA_BITS); fb->Visual.rgbBits = fb->Visual.redBits + fb->Visual.greenBits + fb->Visual.blueBits; - fb->Visual.samples = rb->NumSamples; - fb->Visual.sampleBuffers = rb->NumSamples > 0 ? 1 : 0; if (_mesa_get_format_color_encoding(fmt) == GL_SRGB) fb->Visual.sRGBCapable = ctx->Extensions.EXT_framebuffer_sRGB; break; |