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 <imirkin@alum.mit.edu>
Reviewed-by: Edward O`Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Ilia Mirkin 2016-02-16 01:18:30 -05:00
parent 65dfb3048e
commit 12e3ad2ae9
1 changed files with 1 additions and 1 deletions

View File

@ -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 */