mesa: update derived framebuffer state in GetMultisamplefv
authorMarek Olšák <maraeo@gmail.com>
Sat, 6 Apr 2013 22:22:32 +0000 (00:22 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 10 Apr 2013 00:01:16 +0000 (02:01 +0200)
This makes sure that ctx->DrawBuffer->Visual.samples is up-to-date.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/multisample.c

index b0f45d9332aedd17f86d5b2ee31b92c88d16d7e0..a1edb52efcf9362936fa312bef89d929d4eeb02d 100644 (file)
@@ -30,6 +30,7 @@
 #include "main/mtypes.h"
 #include "main/fbobject.h"
 #include "main/glformats.h"
+#include "main/state.h"
 
 
 /**
@@ -73,6 +74,10 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
 {
    GET_CURRENT_CONTEXT(ctx);
 
+   if (ctx->NewState & _NEW_BUFFERS) {
+      _mesa_update_state(ctx);
+   }
+
    switch (pname) {
    case GL_SAMPLE_POSITION: {
       if (index >= ctx->DrawBuffer->Visual.samples) {