[Mesa-dev] [PATCH] tgsi: lowering support for alpha test

Chris Forbes chrisf at ijw.co.nz
Fri Dec 19 14:18:26 PST 2014


On Sat, Dec 20, 2014 at 8:11 AM, Rob Clark <robdclark at gmail.com> wrote:
> @@ -1452,6 +1593,20 @@ tgsi_transform_lowering(const struct tgsi_lowering_config *config,
>        }
>     }
>
> +   if ((info->processor == TGSI_PROCESSOR_FRAGMENT) &&
> +       config->lower_alpha_test &&
> +       (config->alpha_func != PIPE_FUNC_ALWAYS)) {
> +      int i;
> +      ctx.alpha_test = true;
> +      for (i = 0; i < info->file_max[TGSI_FILE_OUTPUT]; i++) {
> +         /* TODO not sure what to do in case of MRT */
> +         if (info->output_semantic_name[i] == TGSI_SEMANTIC_COLOR) {
> +             ctx.colorout = i;
> +             break;

In the MRT case, alpha test should be based on the value written to
color output 0.
There's a piglit test for this --
tests/spec/arb_draw_buffers/fbo-mrt-alphatest -- since old Intel
hardware has to a similar lowering.

-Chris


More information about the mesa-dev mailing list