mesa: Require per-sample shading if the `sample` qualifier is used.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
Chris Forbes 2013-11-29 21:44:13 +13:00
parent 2625a34bfc
commit 88dc246630
1 changed files with 8 additions and 0 deletions

View File

@ -1049,6 +1049,14 @@ _mesa_get_min_invocations_per_fragment(struct gl_context *ctx,
* has no effect."
*/
if (ctx->Multisample.Enabled) {
/* The ARB_gpu_shader5 specification says:
*
* "Use of the "sample" qualifier on a fragment shader input
* forces per-sample shading"
*/
if (prog->IsSample)
return MAX2(ctx->DrawBuffer->Visual.samples, 1);
if (prog->Base.SystemValuesRead & (SYSTEM_BIT_SAMPLE_ID |
SYSTEM_BIT_SAMPLE_POS))
return MAX2(ctx->DrawBuffer->Visual.samples, 1);