diff options
author | Anuj Phogat <[email protected]> | 2014-01-15 10:23:02 -0800 |
---|---|---|
committer | Anuj Phogat <[email protected]> | 2014-01-21 14:42:28 -0800 |
commit | f5cfb4ae21df8eebfc6b86c0ce858b1c0a9160dd (patch) | |
tree | 8862c7bf3e9e77e31f467300f50588106ec3da20 /src/glx/pixelstore.c | |
parent | a92e5f7cf63d496ad7830b5cea4bbab287c25b8e (diff) |
i965: Ignore 'centroid' interpolation qualifier in case of persample shading
This patch handles the use of 'centroid' qualifier with 'in' variables
in a fragment shader when persample shading is enabled. Per sample
shading for the whole fragment shader can be enabled by:
glEnable(GL_SAMPLE_SHADING) or using {gl_SamplePosition, gl_SampleID}
builtin variables in fragment shader. Explaining it below in more
detail.
/* Enable sample shading using OpenGL API */
glEnable(GL_SAMPLE_SHADING);
glMinSampleShading(1.0);
Example fragment shader:
in vec4 a;
centroid in vec4 b;
main()
{
...
}
Variable 'a' will be interpolated at sample location. But, what
interpolation should we use for variable 'b' ?
ARB_sample_shading recommends interpolation at sample position for
all the variables. GLSL 400 (and earlier) spec says that:
"When an interpolation qualifier is used, it overrides settings
established through the OpenGL API."
But, this text got deleted in later versions of GLSL.
NVIDIA's and AMD's proprietary linux drivers (at OpenGL 4.3)
interpolates at sample position. This convinces me to use
the similar approach on intel hardware.
Cc: [email protected]
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/glx/pixelstore.c')
0 files changed, 0 insertions, 0 deletions