Skip to content

Commit

Permalink
Remove the runtime dependency on libGL again.
Browse files Browse the repository at this point in the history
If libGL.so can not be found, continue to be able to trace
and replay vulkan applications.
  • Loading branch information
AWoloszyn committed May 3, 2018
1 parent 4e14db4 commit d23be2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/os/device/deviceinfo/cc/linux/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ void destroyContext() {
return;
}

if (!core::hasGLorGLES()) {
return;
}

core::DlLoader libX("libX11.so");
pfn_XFree fn_XFree = (pfn_XFree)libX.lookup("XFree");
pfn_XCloseDisplay fn_XCloseDisplay = (pfn_XCloseDisplay)libX.lookup("XCloseDisplay");
Expand All @@ -101,6 +105,9 @@ void destroyContext() {
}

void createGlContext() {
if (!core::hasGLorGLES()) {
return;
}
auto fn_glXChooseFBConfig= (pfn_glXChooseFBConfig)core::GetGlesProcAddress("glXChooseFBConfig", true);
auto fn_glXCreateNewContext = (pfn_glXCreateNewContext)core::GetGlesProcAddress("glXCreateNewContext", true);
auto fn_glXCreatePbuffer = (pfn_glXCreatePbuffer)core::GetGlesProcAddress("glXCreatePbuffer", true);
Expand Down
3 changes: 3 additions & 0 deletions gapis/api/gles/templates/api_imports.cpp.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ namespace gapii {
}
void {{$name}}::resolve() {
if (!core::hasGLorGLES()) {
return;
}
using namespace core;
{{range $c := AllCommands $}}
{{if not (GetAnnotation $c "synthetic")}}
Expand Down

0 comments on commit d23be2e

Please sign in to comment.