summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorAndreas Baierl <[email protected]>2019-06-04 13:23:44 +0200
committerQiang Yu <[email protected]>2019-07-18 13:20:39 +0000
commit24af57407c2b2689394aef5a6666ba33727879a7 (patch)
tree1b8efc09b65dd499d99529e2a4e39b67327d41a5 /src/compiler/glsl
parentb178fdf486f3496270dd4ec12d9bc596d11433ad (diff)
glsl: Optionally declare gl_PointCoord as a system value
Signed-off-by: Andreas Baierl <[email protected]> Reviewed-by: Qiang Yu <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/builtin_variables.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index 56f62132b03..c10ea9e61a5 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -1258,8 +1258,12 @@ builtin_variable_generator::generate_fs_special_vars()
add_input(VARYING_SLOT_FACE, bool_t, "gl_FrontFacing");
if (state->is_version(120, 100)) {
- add_input(VARYING_SLOT_PNTC, vec2_t, GLSL_PRECISION_MEDIUM,
- "gl_PointCoord");
+ if (this->state->ctx->Const.GLSLPointCoordIsSysVal)
+ add_system_value(SYSTEM_VALUE_POINT_COORD, vec2_t,
+ GLSL_PRECISION_MEDIUM, "gl_PointCoord");
+ else
+ add_input(VARYING_SLOT_PNTC, vec2_t, GLSL_PRECISION_MEDIUM,
+ "gl_PointCoord");
}
if (state->has_geometry_shader() || state->EXT_gpu_shader4_enable) {