program: Use _mesa_geometric_samples to calculate gl_NumSamples
authorNeil Roberts <neil@linux.intel.com>
Thu, 4 Feb 2016 16:12:06 +0000 (16:12 +0000)
committerNeil Roberts <neil@linux.intel.com>
Fri, 5 Feb 2016 11:05:06 +0000 (11:05 +0000)
Otherwise it won't take into account the default samples for
framebuffers with no attachments.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/program/prog_statevars.c

index 12490d0c380d7aea96c830b2e8b45809c061d4bf..eed241271dffbbbf92ead44caf98703785156b09 100644 (file)
@@ -40,6 +40,7 @@
 #include "prog_statevars.h"
 #include "prog_parameter.h"
 #include "main/samplerobj.h"
+#include "framebuffer.h"
 
 
 #define ONE_DIV_SQRT_LN2 (1.201122408786449815)
@@ -352,7 +353,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
       }
       return;
    case STATE_NUM_SAMPLES:
-      ((int *)value)[0] = ctx->DrawBuffer->Visual.samples;
+      ((int *)value)[0] = _mesa_geometric_samples(ctx->DrawBuffer);
       return;
    case STATE_DEPTH_RANGE:
       value[0] = ctx->ViewportArray[0].Near;                /* near       */