summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-02-14 20:12:51 +0100
committerMarek Olšák <[email protected]>2018-02-23 20:50:15 +0100
commit605a7f6db51cb946eed508bc9a7adfa753c75e10 (patch)
tree7921ee566f94e6a1ec40930a90c5cef570d94101 /src/compiler
parent14a2c87c41946794a4ea4870a160b70c01225c4f (diff)
mesa: implement ARB_compatibility
Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/builtin_functions.cpp2
-rw-r--r--src/compiler/glsl/builtin_types.cpp2
-rw-r--r--src/compiler/glsl/builtin_variables.cpp2
-rw-r--r--src/compiler/glsl/glsl_parser_extras.cpp1
-rw-r--r--src/compiler/glsl/glsl_parser_extras.h2
5 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 293e8bd638f..5f772c9eaba 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -104,7 +104,7 @@ static bool
compatibility_vs_only(const _mesa_glsl_parse_state *state)
{
return state->stage == MESA_SHADER_VERTEX &&
- state->language_version <= 130 &&
+ (state->compat_shader || state->ARB_compatibility_enable) &&
!state->es_shader;
}
diff --git a/src/compiler/glsl/builtin_types.cpp b/src/compiler/glsl/builtin_types.cpp
index b64f75779bc..7a01cb48bc8 100644
--- a/src/compiler/glsl/builtin_types.cpp
+++ b/src/compiler/glsl/builtin_types.cpp
@@ -288,7 +288,7 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
/* Add deprecated structure types. While these were deprecated in 1.30,
* they're still present. We've removed them in 1.40+ (OpenGL 3.1+).
*/
- if (state->compat_shader) {
+ if (state->compat_shader || state->ARB_compatibility_enable) {
for (unsigned i = 0; i < ARRAY_SIZE(deprecated_types); i++) {
add_type(symbols, deprecated_types[i]);
}
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index a686cb6a457..f0210b60bc7 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -441,7 +441,7 @@ private:
builtin_variable_generator::builtin_variable_generator(
exec_list *instructions, struct _mesa_glsl_parse_state *state)
: instructions(instructions), state(state), symtab(state->symbols),
- compatibility(state->compat_shader || !state->is_version(140, 100)),
+ compatibility(state->compat_shader || state->ARB_compatibility_enable),
bool_t(glsl_type::bool_type), int_t(glsl_type::int_type),
uint_t(glsl_type::uint_type),
uint64_t(glsl_type::uint64_t_type),
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index d99916d8ada..81d74e92ce3 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -616,6 +616,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
EXT(ARB_ES3_2_compatibility),
EXT(ARB_arrays_of_arrays),
EXT(ARB_bindless_texture),
+ EXT(ARB_compatibility),
EXT(ARB_compute_shader),
EXT(ARB_compute_variable_group_size),
EXT(ARB_conservative_depth),
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index 508befd4606..f88cb783473 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -609,6 +609,8 @@ struct _mesa_glsl_parse_state {
bool ARB_arrays_of_arrays_warn;
bool ARB_bindless_texture_enable;
bool ARB_bindless_texture_warn;
+ bool ARB_compatibility_enable;
+ bool ARB_compatibility_warn;
bool ARB_compute_shader_enable;
bool ARB_compute_shader_warn;
bool ARB_compute_variable_group_size_enable;