summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-02-16 01:18:30 -0500
committerIlia Mirkin <[email protected]>2016-02-18 12:35:28 -0500
commit12e3ad2ae98a560e2527f4f28423920a15570590 (patch)
tree032563053372842af0c8e5595a63b2aa28e9bda0 /src
parent65dfb3048e8291675ca33581aeff8921f7ea509d (diff)
mesa: gl_NumSamples should always be at least one
From ARB_sample_shading: "gl_NumSamples is the total number of samples in the framebuffer, or one if rendering to a non-multisample framebuffer" So make sure to always pass in at least 1. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Edward O`Callaghan <[email protected]> Reviewed-by: Neil Roberts <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/program/prog_statevars.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c
index eed241271df..489f75fd577 100644
--- a/src/mesa/program/prog_statevars.c
+++ b/src/mesa/program/prog_statevars.c
@@ -353,7 +353,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
}
return;
case STATE_NUM_SAMPLES:
- ((int *)value)[0] = _mesa_geometric_samples(ctx->DrawBuffer);
+ ((int *)value)[0] = MAX2(1, _mesa_geometric_samples(ctx->DrawBuffer));
return;
case STATE_DEPTH_RANGE:
value[0] = ctx->ViewportArray[0].Near; /* near */