[Mesa-dev] [PATCH 2/3] mesa: use geometric helper for computing min samples

eocallaghan at alterapraxis.com eocallaghan at alterapraxis.com
Sat Jan 30 22:28:33 PST 2016


Reviewed-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>

On 2016-01-31 16:58, Ilia Mirkin wrote:
> In case we have a draw buffer without attachments, we should be looking
> at the default number of samples.
> 
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> 
> Still doesn't work properly on nvc0, but at least the right number of
> min samples gets passed along.
> 
>  src/mesa/program/program.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
> index 0e78e6a..27867c4 100644
> --- a/src/mesa/program/program.c
> +++ b/src/mesa/program/program.c
> @@ -31,6 +31,7 @@
> 
>  #include "main/glheader.h"
>  #include "main/context.h"
> +#include "main/framebuffer.h"
>  #include "main/hash.h"
>  #include "main/macros.h"
>  #include "program.h"
> @@ -534,14 +535,14 @@ _mesa_get_min_invocations_per_fragment(struct
> gl_context *ctx,
>         *  forces per-sample shading"
>         */
>        if (prog->IsSample && !ignore_sample_qualifier)
> -         return MAX2(ctx->DrawBuffer->Visual.samples, 1);
> +         return MAX2(_mesa_geometric_samples(ctx->DrawBuffer), 1);
> 
>        if (prog->Base.SystemValuesRead & (SYSTEM_BIT_SAMPLE_ID |
>                                           SYSTEM_BIT_SAMPLE_POS))
> -         return MAX2(ctx->DrawBuffer->Visual.samples, 1);
> +         return MAX2(_mesa_geometric_samples(ctx->DrawBuffer), 1);
>        else if (ctx->Multisample.SampleShading)
>           return MAX2(ceil(ctx->Multisample.MinSampleShadingValue *
> -                          ctx->DrawBuffer->Visual.samples), 1);
> +                          _mesa_geometric_samples(ctx->DrawBuffer)), 
> 1);
>        else
>           return 1;
>     }



More information about the mesa-dev mailing list