[virglrenderer-devel] [PATCH] expand gl_SampleMask to ivec4 to match TGSI definition

Erik Faye-Lund erik.faye-lund at collabora.com
Fri Jul 6 07:00:56 UTC 2018

On 06. juli 2018 02:12, Dave Airlie wrote:
> On 5 July 2018 at 17:43, Erik Faye-Lund<erik.faye-lund at collabora.com>  wrote:
>> TGSI defines TGSI_SEMANTIC_SAMPLEMASK to be a four-compoent integer
>> vector, with the x component set to the same value as gl_SampleMask,
>> and the y, z and w components set to 0.
> I think the other patch was more correct, the value is SV[0].xxxx, which means
> it's swizzled X into all 4 components.

I don't think so. Here's what the documentation says:


"If MSAA is not enabled, the value is (1, 0, 0, 0).

For an output, the sample mask is used to disable further sample processing.

For both, the register type is uint[4] but only the X component is used
(i.e. gl_SampleMask[0])."

If we repeat the same value to all components, we don't fulfill the
(1, 0, 0, 0)-bit.

So I think this is a more accurate implementation than repeating, even 
it *probably* doesn't matter much, as I think only hand-written TGSI shaders
can actually reach the other components. And I seriously doubt we have any
hand-written TGSI that cases about the distinction...

More information about the virglrenderer-devel mailing list