Skip to content

Commit

Permalink
Revert "Add a hack to use #version 110 but keep using 130 features, f…
Browse files Browse the repository at this point in the history
…or the benefit of OS X."

This turned out not to work well on OS X after all.

This reverts commit e0811dd.
  • Loading branch information
sesse committed Dec 14, 2015
1 parent 4cf76ac commit f907b7b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
9 changes: 1 addition & 8 deletions init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,14 +437,7 @@ bool init_movit(const string& data_directory, MovitDebugLevel debug_level)
if (get_glsl_version() < 1.30f) {
fprintf(stderr, "Movit system requirements: Needs at least GLSL version 1.30 (has version %.1f)\n",
get_glsl_version());
if (get_glsl_version() >= 1.10f) {
fprintf(stderr, "Attempting to continue nevertheless; expect shader compilation issues.\n");
fprintf(stderr, "Try switching to a core OpenGL context, as especially OS X drivers\n");
fprintf(stderr, "support newer GLSL versions there.\n");
movit_shader_model = MOVIT_GLSL_130_AS_110;
} else {
return false;
}
return false;
}
if (get_glsl_version() < 1.50f) {
movit_shader_model = MOVIT_GLSL_130;
Expand Down
2 changes: 1 addition & 1 deletion init.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extern bool movit_timer_queries_supported;
// What shader model we are compiling for. This only affects the choice
// of a few files (like header.frag); most of the shaders are the same.
enum MovitShaderModel {
MOVIT_GLSL_130_AS_110, // Use 1.30 features freely, but use #version 110.
MOVIT_GLSL_110, // No longer in use, but kept until next ABI break in order not to change the enums.
MOVIT_GLSL_130,
MOVIT_ESSL_300,
MOVIT_GLSL_150,
Expand Down
7 changes: 1 addition & 6 deletions util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,7 @@ string read_file(const string &filename)

string read_version_dependent_file(const string &base, const string &extension)
{
if (movit_shader_model == MOVIT_GLSL_130_AS_110) {
string contents = read_file(base + ".130." + extension);
assert(contents.find("#version 130") == 0);
contents[10] = '1'; // Change from 130 to 110.
return contents;
} else if (movit_shader_model == MOVIT_GLSL_130) {
if (movit_shader_model == MOVIT_GLSL_130) {
return read_file(base + ".130." + extension);
} else if (movit_shader_model == MOVIT_GLSL_150) {
return read_file(base + ".150." + extension);
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
// changes, even within git versions. There is no specific version
// documentation outside the regular changelogs, though.

#define MOVIT_VERSION 15
#define MOVIT_VERSION 16

#endif // !defined(_MOVIT_VERSION_H)

0 comments on commit f907b7b

Please sign in to comment.