diff options
author | marha <marha@users.sourceforge.net> | 2014-09-08 23:30:36 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-09-08 23:30:36 +0200 |
commit | e16399e57caac9e859a7d28921c73ef9839b571e (patch) | |
tree | b86ed43f749ebfe0bb3842fcd76a34e386011fcc /mesalib/src/mesa/drivers/common/meta.c | |
parent | 166caebfaa2b217332a345ffb02c5b9e52f65a3d (diff) | |
parent | cb346e228aeb500cd61ec86644c034c238332d3b (diff) | |
download | vcxsrv-e16399e57caac9e859a7d28921c73ef9839b571e.tar.gz vcxsrv-e16399e57caac9e859a7d28921c73ef9839b571e.tar.bz2 vcxsrv-e16399e57caac9e859a7d28921c73ef9839b571e.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/drivers/common/meta.c')
-rw-r--r-- | mesalib/src/mesa/drivers/common/meta.c | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index 90befd42d..7a8e627ba 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -396,25 +396,6 @@ _mesa_meta_init(struct gl_context *ctx) ctx->Meta = CALLOC_STRUCT(gl_meta_state); } -static GLenum -gl_buffer_index_to_drawbuffers_enum(gl_buffer_index bufindex) -{ - assert(bufindex < BUFFER_COUNT); - - if (bufindex >= BUFFER_COLOR0) - return GL_COLOR_ATTACHMENT0 + bufindex - BUFFER_COLOR0; - else if (bufindex == BUFFER_FRONT_LEFT) - return GL_FRONT_LEFT; - else if (bufindex == BUFFER_FRONT_RIGHT) - return GL_FRONT_RIGHT; - else if (bufindex == BUFFER_BACK_LEFT) - return GL_BACK_LEFT; - else if (bufindex == BUFFER_BACK_RIGHT) - return GL_BACK_RIGHT; - - return GL_NONE; -} - /** * Free context meta-op state. * To be called once during context destruction. @@ -806,20 +787,9 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) } if (state & MESA_META_DRAW_BUFFERS) { - int buf, real_color_buffers = 0; - memset(save->ColorDrawBuffers, 0, sizeof(save->ColorDrawBuffers)); - - for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) { - int buf_index = ctx->DrawBuffer->_ColorDrawBufferIndexes[buf]; - if (buf_index == -1) - continue; - - save->ColorDrawBuffers[buf] = - gl_buffer_index_to_drawbuffers_enum(buf_index); - - if (++real_color_buffers >= ctx->DrawBuffer->_NumColorDrawBuffers) - break; - } + struct gl_framebuffer *fb = ctx->DrawBuffer; + memcpy(save->ColorDrawBuffers, fb->ColorDrawBuffer, + sizeof(save->ColorDrawBuffers)); } /* misc */ @@ -1224,7 +1194,7 @@ _mesa_meta_end(struct gl_context *ctx) _mesa_BindRenderbuffer(GL_RENDERBUFFER, save->RenderbufferName); if (state & MESA_META_DRAW_BUFFERS) { - _mesa_DrawBuffers(ctx->Const.MaxDrawBuffers, save->ColorDrawBuffers); + _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, save->ColorDrawBuffers, NULL); } ctx->Meta->SaveStackDepth--; @@ -1250,7 +1220,7 @@ _mesa_meta_in_progress(struct gl_context *ctx) * Used by the meta-Clear, Draw/CopyPixels and Bitmap functions where the Z * value comes from the clear value or raster position. */ -static INLINE GLfloat +static inline GLfloat invert_z(GLfloat normZ) { GLfloat objZ = 1.0f - 2.0f * normZ; |