glsl: guard gl_NumSamples enablement on ARB_sample_shading
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 18 Jun 2015 23:08:24 +0000 (19:08 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 19 Jun 2015 00:40:22 +0000 (20:40 -0400)
gl_NumSamples should only be enabled when ARB_sample_shading is enabled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/glsl/builtin_variables.cpp

index c52b252679757e983541dbc0d925443e927c71f9..a765d35fde0658e19a42eae1950970c843be88aa 100644 (file)
@@ -764,7 +764,8 @@ builtin_variable_generator::generate_constants()
 void
 builtin_variable_generator::generate_uniforms()
 {
-   add_uniform(int_t, "gl_NumSamples");
+   if (state->is_version(400, 0) || state->ARB_sample_shading_enable)
+      add_uniform(int_t, "gl_NumSamples");
    add_uniform(type("gl_DepthRangeParameters"), "gl_DepthRange");
    add_uniform(array(vec4_t, VERT_ATTRIB_MAX), "gl_CurrentAttribVertMESA");
    add_uniform(array(vec4_t, VARYING_SLOT_MAX), "gl_CurrentAttribFragMESA");