summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtin_variables.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-04-28 12:50:51 -0700
committerIan Romanick <[email protected]>2015-05-04 13:49:58 -0700
commitad14f44b3e89cf4d05d29f2aaf9f64fe0e42af3b (patch)
treedc7cf71bd1608bbdbb3f18a6d7e0a882be6afbe2 /src/glsl/builtin_variables.cpp
parentdd61475d56f3b94c3586889333931ebe50a32c3e (diff)
glsl/es3.1: Allow interger mix built-ins in GLSL ES 3.10
v2: Add missing lexer support. Noticed by Tapani. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> [v1]
Diffstat (limited to 'src/glsl/builtin_variables.cpp')
-rw-r--r--src/glsl/builtin_variables.cpp35
1 files changed, 31 insertions, 4 deletions
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index 9d0b27209e7..6806aa1f962 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -656,16 +656,43 @@ builtin_variable_generator::generate_constants()
if (state->has_atomic_counters()) {
add_const("gl_MaxVertexAtomicCounters",
state->Const.MaxVertexAtomicCounters);
- add_const("gl_MaxGeometryAtomicCounters",
- state->Const.MaxGeometryAtomicCounters);
add_const("gl_MaxFragmentAtomicCounters",
state->Const.MaxFragmentAtomicCounters);
add_const("gl_MaxCombinedAtomicCounters",
state->Const.MaxCombinedAtomicCounters);
add_const("gl_MaxAtomicCounterBindings",
state->Const.MaxAtomicBufferBindings);
- add_const("gl_MaxTessControlAtomicCounters", 0);
- add_const("gl_MaxTessEvaluationAtomicCounters", 0);
+
+ /* When Mesa adds support for GL_OES_geometry_shader and
+ * GL_OES_tessellation_shader, this will need to change.
+ */
+ if (!state->es_shader) {
+ add_const("gl_MaxGeometryAtomicCounters",
+ state->Const.MaxGeometryAtomicCounters);
+ add_const("gl_MaxTessControlAtomicCounters", 0);
+ add_const("gl_MaxTessEvaluationAtomicCounters", 0);
+ }
+ }
+
+ if (state->is_version(420, 310)) {
+ add_const("gl_MaxVertexAtomicCounterBuffers",
+ state->Const.MaxVertexAtomicCounterBuffers);
+ add_const("gl_MaxFragmentAtomicCounterBuffers",
+ state->Const.MaxFragmentAtomicCounterBuffers);
+ add_const("gl_MaxCombinedAtomicCounterBuffers",
+ state->Const.MaxCombinedAtomicCounterBuffers);
+ 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) {
+ add_const("gl_MaxGeometryAtomicCounterBuffers",
+ state->Const.MaxGeometryAtomicCounterBuffers);
+ add_const("gl_MaxTessControlAtomicCounterBuffers", 0);
+ add_const("gl_MaxTessEvaluationAtomicCounterBuffers", 0);
+ }
}
if (state->is_version(430, 0) || state->ARB_compute_shader_enable) {