Skip to content

Commit

Permalink
UPBGE: Enable more compatible GLSL versions.
Browse files Browse the repository at this point in the history
This commit with the condition of ARB_compatiblity allow to select an higher GLSL version
in the function gpu_shader_version.
ARB_compatibility is needed as > GLSL 150 doesn't support builtin natives.
  • Loading branch information
panzergame committed Aug 26, 2018
1 parent 3ce5565 commit bf69125
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions source/blender/gpu/intern/gpu_shader.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,29 @@ static void shader_print_errors(const char *task, const char *log, const char **

static const char *gpu_shader_version(void)
{
if (GLEW_ARB_compatibility) {
if (GLEW_VERSION_4_5) {
return "#version 450 compatibility\n";
}
else if (GLEW_VERSION_4_4) {
return "#version 440 compatibility\n";
}
else if (GLEW_VERSION_4_3) {
return "#version 430 compatibility\n";
}
else if (GLEW_VERSION_4_2) {
return "#version 420 compatibility\n";
}
else if (GLEW_VERSION_4_1) {
return "#version 410 compatibility\n";
}
else if (GLEW_VERSION_4_0) {
return "#version 400 compatibility\n";
}
else if (GLEW_VERSION_3_3) {
return "#version 330 compatibility\n";
}
}
if (GLEW_VERSION_3_2) {
if (GLEW_ARB_compatibility) {
return "#version 150 compatibility\n";
Expand Down

0 comments on commit bf69125

Please sign in to comment.