Re: [Mesa-dev] [PATCH 5/8] radeonsi: implement SAMPLEPOS fragment shader input

2014-05-07 Thread Roland Scheidegger
Am 07.05.2014 17:56, schrieb Marek Olšák: > I could enable interpolation of gl_FragCoord at the sample instead of > centroid and do: > > gl_SamplePos = fract(gl_FragCoord.xy); > gl_FragCoord.xy = floor(gl_FragCoord.xy) + vec2(0.5); // center > > However, I wouldn't be able to get gl_FragCoord at

Re: [Mesa-dev] [PATCH 5/8] radeonsi: implement SAMPLEPOS fragment shader input

2014-05-07 Thread Marek Olšák
It's a pseudo-code that would be inserted at the beginning of the shader by the shader compiler. gl_SamplePos is always read-only from a user's point of view. Marek On Wed, May 7, 2014 at 6:02 PM, Ilia Mirkin wrote: > On Wed, May 7, 2014 at 11:56 AM, Marek Olšák wrote: >> I could enable interpo

Re: [Mesa-dev] [PATCH 5/8] radeonsi: implement SAMPLEPOS fragment shader input

2014-05-07 Thread Ilia Mirkin
On Wed, May 7, 2014 at 11:56 AM, Marek Olšák wrote: > I could enable interpolation of gl_FragCoord at the sample instead of > centroid and do: > > gl_SamplePos = fract(gl_FragCoord.xy); Is that legal? I didn't think that sample position could be an output, at least not with ARB_sample_shading (an

Re: [Mesa-dev] [PATCH 5/8] radeonsi: implement SAMPLEPOS fragment shader input

2014-05-07 Thread Marek Olšák
I could enable interpolation of gl_FragCoord at the sample instead of centroid and do: gl_SamplePos = fract(gl_FragCoord.xy); gl_FragCoord.xy = floor(gl_FragCoord.xy) + vec2(0.5); // center However, I wouldn't be able to get gl_FragCoord at the centroid. I'm also not sure how gl_FragCoord should

Re: [Mesa-dev] [PATCH 5/8] radeonsi: implement SAMPLEPOS fragment shader input

2014-05-07 Thread Ilia Mirkin
On Wed, May 7, 2014 at 10:00 AM, Marek Olšák wrote: > From: Marek Olšák > > The sample positions are read from a constant buffer. FWIW I had to do the same thing in both nv50 and nvc0. I had proposed that this should actually be done directly by the state tracker, but I think claims were made to

[Mesa-dev] [PATCH 5/8] radeonsi: implement SAMPLEPOS fragment shader input

2014-05-07 Thread Marek Olšák
From: Marek Olšák The sample positions are read from a constant buffer. --- src/gallium/drivers/radeon/cayman_msaa.c | 17 + src/gallium/drivers/radeon/r600_pipe_common.c | 1 + src/gallium/drivers/radeon/r600_pipe_common.h | 10 ++ src/gallium/drivers/radeonsi/si_s