summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtin_variables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/builtin_variables.cpp')
-rw-r--r--src/glsl/builtin_variables.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index 221aab0043b..ccc04c00cea 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -667,7 +667,7 @@ builtin_variable_generator::generate_constants()
add_const("gl_MaxVaryingComponents", state->ctx->Const.MaxVarying * 4);
}
- if (state->is_version(150, 0)) {
+ if (state->has_geometry_shader()) {
add_const("gl_MaxVertexOutputComponents",
state->Const.MaxVertexOutputComponents);
add_const("gl_MaxGeometryInputComponents",
@@ -730,12 +730,11 @@ builtin_variable_generator::generate_constants()
add_const("gl_MaxAtomicCounterBindings",
state->Const.MaxAtomicBufferBindings);
- /* When Mesa adds support for GL_OES_geometry_shader and
- * GL_OES_tessellation_shader, this will need to change.
- */
- if (!state->es_shader) {
+ if (state->has_geometry_shader()) {
add_const("gl_MaxGeometryAtomicCounters",
state->Const.MaxGeometryAtomicCounters);
+ }
+ if (!state->es_shader) {
add_const("gl_MaxTessControlAtomicCounters",
state->Const.MaxTessControlAtomicCounters);
add_const("gl_MaxTessEvaluationAtomicCounters",
@@ -753,12 +752,11 @@ builtin_variable_generator::generate_constants()
add_const("gl_MaxAtomicCounterBufferSize",
state->Const.MaxAtomicCounterBufferSize);
- /* When Mesa adds support for GL_OES_geometry_shader and
- * GL_OES_tessellation_shader, this will need to change.
- */
- if (!state->es_shader) {
+ if (state->has_geometry_shader()) {
add_const("gl_MaxGeometryAtomicCounterBuffers",
state->Const.MaxGeometryAtomicCounterBuffers);
+ }
+ if (!state->es_shader) {
add_const("gl_MaxTessControlAtomicCounterBuffers",
state->Const.MaxTessControlAtomicCounterBuffers);
add_const("gl_MaxTessEvaluationAtomicCounterBuffers",
@@ -814,13 +812,16 @@ builtin_variable_generator::generate_constants()
add_const("gl_MaxCombinedImageUniforms",
state->Const.MaxCombinedImageUniforms);
+ if (state->has_geometry_shader()) {
+ add_const("gl_MaxGeometryImageUniforms",
+ state->Const.MaxGeometryImageUniforms);
+ }
+
if (!state->es_shader) {
add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs",
state->Const.MaxCombinedShaderOutputResources);
add_const("gl_MaxImageSamples",
state->Const.MaxImageSamples);
- add_const("gl_MaxGeometryImageUniforms",
- state->Const.MaxGeometryImageUniforms);
}
if (state->is_version(450, 310)) {
@@ -1070,7 +1071,7 @@ builtin_variable_generator::generate_fs_special_vars()
if (state->is_version(120, 100))
add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord");
- if (state->is_version(150, 0)) {
+ if (state->has_geometry_shader()) {
var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
var->data.interpolation = INTERP_QUALIFIER_FLAT;
}