[Mesa-dev] [RFCv3 05/11] nir: add lowering pass for y-transform

Ilia Mirkin imirkin at alum.mit.edu
Mon Feb 1 16:31:40 UTC 2016


On Mon, Feb 1, 2016 at 11:00 AM, Connor Abbott <cwabbott0 at gmail.com> wrote:
>> +/* NIR equiv of TGSI CMP instruction: */
>> +static nir_ssa_def *
>> +nir_cmp(nir_builder *b, nir_ssa_def *src0, nir_ssa_def *src1, nir_ssa_def *src2)
>> +{
>> +   return nir_bcsel(b, nir_flt(b, src0, nir_imm_float(b, 0.0)), src1, src2);
>
> I'm not that familiar with TGSI, but you're selecting src1 if src0 is
> less than zero, which seems... not quite right. Is that really how
> TGSI CMP works?

http://gallium.readthedocs.org/en/latest/tgsi.html#opcode-CMP

I think so.

  -ilia


More information about the mesa-dev mailing list