Skip to content
Snippets Groups Projects
Commit 559d9b89 authored by Anuj Phogat's avatar Anuj Phogat Committed by Carl Worth
Browse files

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.

Signed-off-by: default avatarAnuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: default avatarChris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit f5cfb4ae)

and

i965: Ignore 'centroid' interpolation qualifier in case of persample shading

I missed this change in commit f5cfb4ae. It fixes the incorrect
rendering caused in Dolphin Emulator.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73915



Signed-off-by: default avatarAnuj Phogat <anuj.phogat@gmail.com>
Tested-by: default avatarMarkus Wick <wickmarkus@web.de>
Reviewed-by: default avatarMatt Turner <mattst88@gmail.com>
(cherry picked from commit dc2f94bc)
parent 765e3d37
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment