summaryrefslogtreecommitdiff
path: root/src/mesa/main/state.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@tungstengraphics.com>2008-07-02 20:20:33 +0200
committerRoland Scheidegger <sroland@tungstengraphics.com>2008-07-02 20:21:06 +0200
commit5ef4e4ffb8053db87f52df3c9b2ddb71d9c7d6e5 (patch)
tree0ede7c8b1c6e98a20205109a888352255db46cbc /src/mesa/main/state.c
parent6befdca6a3d65d7e49c0c54a7a8f091cd05034ea (diff)
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.
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r--src/mesa/main/state.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 1c73c5c462..7192bed4a3 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1061,6 +1061,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
@@ -1223,6 +1237,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 );