Add inter-process communcation to shader cache

This change allows running several instances of CTS which share a single
shader cache.

std::map which was used to hold the cache index was replaced by a simple
binary search tree implementation in order to play nice in a
pre-allocated buffer. Benchmarking gives approximately same performance
or better in random cases. Worst case behavior is terrible, but did not
occur while testing after integrating with CTS.

By default the size of the index is 1M entries, taking 16M of memory.
This memory pool is not resized dynamically, and will assert if over 1M
unique shaders are inserted to the cache.

Additional small improvement to the shader cache behavior avoids
re-hashing the cache key at cache miss.

For platforms that do not support IPC, the IPC code can be compiled out
using a predefined macro DISABLE_SHADERCACHE_IPC.

The IPC behavior is disabled by default, leading to old behavior, except
for the std::map to bst change and no re-hashing.

Affects:
*

VK-GL-CTS issue: 3565

Change-Id: I4f2433256968b76de26c9bd50981454bb4accae0
5 files changed
tree: 4c54753143f98500c80f227cb4ca5cd3b4bf9ee3
  1. .github/
  2. android/
  3. data/
  4. doc/
  5. execserver/
  6. executor/
  7. external/
  8. framework/
  9. modules/
  10. scripts/
  11. targets/
  12. .editorconfig
  13. .gitattributes
  14. .gitignore
  15. Android.mk
  16. AndroidGen.mk
  17. CMakeLists.txt
  18. CODE_OF_CONDUCT.md
  19. LICENSE
  20. MODULE_LICENSE_APACHE2
  21. NOTICE
  22. OWNERS
  23. README.md
README.md

dEQP README

This repository contains a GPU testing suite called dEQP (drawElements Quality Program). dEQP contains tests for several graphics APIs, including OpenGL ES, EGL, and Vulkan.

Documentation

Up-to-date documentation for dEQP is available at:

The .qpa logs generated by the conformance tests may contain embedded PNG images of the results. These can be viewed with scripts/qpa_image_viewer.html, by opening the file with a web browser and following its instructions, or using the Cherry tool.

Khronos Vulkan Conformance Tests

This repository includes Khronos Vulkan CTS under external/vulkancts directory. For more information see Vulkan CTS README.

Khronos OpenGL / OpenGL ES Conformance Tests

This repository includes Khronos OpenGL / OpenGL ES CTS under external/openglcts directory. For more information see OpenGL / OpenGL ES CTS README.

ANGLE for Android

ANGLE can be built for Android by following the instructions here.

The resulting ANGLE shared object libraries can be linked against and embedded into dEQP.apk with the --angle-path option. This will cause dEQP.apk to use the ANGLE libraries for OpenGL ES calls, rather than the native drivers.

An ABI must be specified and the directory structure containing the ANGLE shared objects must match it so the build system can find the correct *.so files.

Assuming ANGLE shared objects are generated into ~/chromium/src/out/Release/ and dEQP.apk will be generated with --abis arm64-v8a, issue the following commands:

cd ~/chromium/src/out/Release/
mkdir arm64-v8a && cd arm64-v8a
cp ../lib*_angle.so .

The --angle-path ~/chromium/src/out/Release/ option can then be used to link against and embed the ANGLE shared object files. The full command would be:

python scripts/android/build_apk.py --sdk <path to Android SDK> --ndk <path to Android NDK> --abis arm64-v8a --angle-path ~/chromium/src/out/Release/