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

Rob Clark robdclark at gmail.com
Fri Dec 19 14:29:45 PST 2014


On Fri, Dec 19, 2014 at 5:18 PM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> 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.
>

ahh, great, then it should be right the way I have it..  some day I'll
actually get around to implementing MRT so I can test it ;-)

BR,
-R

> -Chris


More information about the mesa-dev mailing list