summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/multisample.c2
-rw-r--r--src/mesa/main/state.c17
3 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 0a065541e1f..00e7d5d395d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -961,6 +961,7 @@ struct gl_list_extensions
struct gl_multisample_attrib
{
GLboolean Enabled;
+ GLboolean _Enabled; /**< true if Enabled and multisample buffer */
GLboolean SampleAlphaToCoverage;
GLboolean SampleAlphaToOne;
GLboolean SampleCoverage;
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index e138087436e..b9cfad92160 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -57,7 +57,7 @@ _mesa_SampleCoverageARB(GLclampf value, GLboolean invert)
void
_mesa_init_multisample(GLcontext *ctx)
{
- ctx->Multisample.Enabled = GL_FALSE;
+ ctx->Multisample.Enabled = GL_TRUE;
ctx->Multisample.SampleAlphaToCoverage = GL_FALSE;
ctx->Multisample.SampleAlphaToOne = GL_FALSE;
ctx->Multisample.SampleCoverage = GL_FALSE;
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 315253d90a7..344af91e172 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -289,6 +289,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.
*/
static void
@@ -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 );