[Mesa-dev] [PATCH 8/8 v2] i965: Enable EXT_shader_samples_identical

Neil Roberts neil at linux.intel.com
Thu Nov 19 09:34:58 PST 2015


Jason Ekstrand <jason at jlekstrand.net> writes:

> On Nov 18, 2015 6:38 PM, "Ian Romanick" <idr at freedesktop.org> wrote:
>>
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> v2: Handle immediate value for MCS smarter.  Rebase on changes to
>> nir_texop_sampels_identical (missing second parameter).  Suggested by
>> Jason.  This still doesn't handle the 16x MSAA case.

16x MSAA has a field in the program sampler key because it needs a new
instruction to fetch from the texture. For 16x MSAA it just uses two of
the registers that are returned by the MCS fetch instruction instead of
just one. Maybe you could do something like this:

      if (mcs.file == BRW_IMMEDIATE_VALUE) {
         bld.MOV(dst, fs_reg(0));
      } else if ((key_tex->msaa_16 & (1 << sampler))) {
         fs_reg tmp = vgrf(glsl_type::uint_type);
         bld.OR(tmp, mcs, offset(mcs, bld, 1));
         bld.CMP(dst, tmp, src_reg(0u), BRW_CONDITIONAL_EQ);
      } else {
         bld.CMP(dst, mcs, src_reg(0u), BRW_CONDITIONAL_EQ);
      }

I tested this on my SKL and it passes all of your Piglit tests. The
optimiser quite neatly removes the second instruction and the temporary
register in the 16x case and makes the OR directly update the flag
registers, so it is possibly the same cost as the 8x case in practice.

I can confirm that I've already pushed the 16x MSAA patches to master.

Regards,
- Neil


More information about the mesa-dev mailing list