Skip to content

Commit

Permalink
proper linking support for GLES2 and GLES3 families
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-rogovin committed May 14, 2014
1 parent 9b24392 commit a6776ca
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile.settings
Expand Up @@ -26,7 +26,7 @@ GLES_LIB_PATH_FLAGS= -L/opt/mesa/lib
# 2 = GLES2 or OpenGL 2.x # 2 = GLES2 or OpenGL 2.x
# 3 = GLES3 or OpenGL 3.x Core # 3 = GLES3 or OpenGL 3.x Core
# 4 = GLES4(when it appears) or OpenGL 4.x Core # 4 = GLES4(when it appears) or OpenGL 4.x Core
GL_VERSION=2 GL_VERSION=3


# GL type # GL type
# 0 = GLES # 0 = GLES
Expand All @@ -45,6 +45,7 @@ GL_VERSION=2
# OVERRIDE_GL_TYPE=1 # for desktop GL # OVERRIDE_GL_TYPE=1 # for desktop GL


GL_TYPE=1 GL_TYPE=1

ifeq ($(findstring arm,$(shell uname -m)),arm) ifeq ($(findstring arm,$(shell uname -m)),arm)
GL_TYPE=0 GL_TYPE=0
endif endif
Expand Down
18 changes: 17 additions & 1 deletion ngl_generator/filter.cpp
Expand Up @@ -26,12 +26,28 @@
bool bool
use_function_pointer(const std::string &filename) use_function_pointer(const std::string &filename)
{ {
return true;

/*
Bah humbug: just require that ngl_backend implementation
can handle functions that are core in GLES2.so The issue
is that GLES3 is the same .so as GLES2, so to get its
function pointers means one needs to use eglGetProcAddress,
so telling by the filename will not work. The correct thing
is that we have a list of all the GLES2 core functions
and if it is not one of those, then do the eglGetProcAdress.
However, dlopen and dlsym can be used instead to get the
function pointers even if the function is core GLES2,
so we just always fetch the fnction pointer.
return filename.find("gl2.h")==std::string::npos; return filename.find("gl2.h")==std::string::npos;
*/
} }






int main(int argc, char **argv) int
main(int argc, char **argv)
{ {
/*read each file passed and output them to stdout after filtering */ /*read each file passed and output them to stdout after filtering */


Expand Down
6 changes: 5 additions & 1 deletion src/WRATH/gl/WRATHGPUConfig.cpp
Expand Up @@ -76,9 +76,13 @@ WRATHGPUConfig::
default_shader_version(void) default_shader_version(void)
{ {
#if defined(WRATH_GLES_VERSION) && WRATH_GLES_VERSION>=3 #if defined(WRATH_GLES_VERSION) && WRATH_GLES_VERSION>=3
{
return "300 es"; return "300 es";
}
#elif defined(WRATH_GL_VERSION) && WRATH_GL_VERSION>=3 #elif defined(WRATH_GL_VERSION) && WRATH_GL_VERSION>=3
return "330 core"; {
return "130";
}
#endif #endif


return ""; return "";
Expand Down

0 comments on commit a6776ca

Please sign in to comment.