mesa: fix issues around multisample enable

multisample enable is enabled by default, however gl mandates multisample
rendering rules only apply if there's also a multisampled buffer.
This commit is contained in:
Roland Scheidegger
2008-07-02 20:08:27 +02:00
parent cc31eecbcb
commit 489fc4d10a
6 changed files with 22 additions and 4 deletions

View File

@@ -288,6 +288,20 @@ update_viewport_matrix(GLcontext *ctx)
}
/**
* Update derived multisample state.
*/
static void
update_multisample(GLcontext *ctx)
{
ctx->Multisample._Enabled = GL_FALSE;
if (ctx->DrawBuffer) {
if (ctx->DrawBuffer->Visual.sampleBuffers)
ctx->Multisample._Enabled = GL_TRUE;
}
}
/**
* Update derived color/blend/logicop state.
*/
@@ -425,6 +439,9 @@ _mesa_update_state_locked( GLcontext *ctx )
if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT))
update_viewport_matrix(ctx);
if (new_state & _NEW_MULTISAMPLE)
update_multisample( ctx );
if (new_state & _NEW_COLOR)
update_color( ctx );