elucideye / drishti

Real time eye tracking for embedded and mobile devices.
BSD 3-Clause "New" or "Revised" License
390 stars 82 forks source link

use swiftshader for gpu tests w/ platform != android #649

Open headupinclouds opened 6 years ago

headupinclouds commented 6 years ago

Currently we rely on Android's QEMU HW emulator to run the full OpenGL tests on CI platforms that don't provide GPU's. SwiftShader should be a nice module alternative for other platforms (preferable to mesa).

See: https://github.com/google/swiftshader

:point_up: swiftshader implements OpenGL ES, whereas the non-mobile toolchains technically link to OpenGL (not OpenGL ES) and use reduced functionality (compatible with OpenGL ES + GLSL 1.1. shaders). Ideally it would be possible to build all libraries as-is, linking against the system OpenGL libs so the assets can be deployed on the release page, while using a shared library build of swiftshader as a runtime replacement for the system OpenGL to enable the various GPGPU unit tests on the CI platforms. This may not be possible, in which case a more intrusive integration may be required to support the tests. This would have a significant impact on the build, as various #include <...> paths and potentially CMake find_package() + target_link_libraries() calls would have to be updated.

In ogles_gpgpu, for example, we use osmesa on linux platforms (via apt-get) and create both a standard ogles_gpgpu library for the release and a separate ogles_gpgpu_cpu lib for the CPU based OpenGL shader tests.

See: https://github.com/hunter-packages/ogles_gpgpu/blob/fa1978165d97307af1102c4cc7d317cccf79a58e/ogles_gpgpu/CMakeLists.txt#L59-L93

If a workable approach is identified we can:

ruslo commented 6 years ago

Current state: segmentation fault in test https://travis-ci.org/elucideye/drishti/builds/383628469