These steps are specifically for testing SwiftShader's OpenGL ES 3.0 implementation using dEQP on Windows (Linux differences at the bottom).
Add <path to python>
to your PATH environment variable
Add <path to MinGW>\bin
to your PATH environment variable
Add <path to adb>
to your PATH environment variable
Note: abd is in the Android SDK, typically in C:\Users\<username>\AppData\Local\Android\sdk\platform-tools
Install GCC. In ‘cmd’, run:
mingw-get install gcc
Note: Using Cygwin GCC currently doesn't work.
(Optional) Install TortoiseGit
Get dEQP (either in ‘cmd’ or by using TortoiseGit):
git clone https://android.googlesource.com/platform/external/deqp
Get dEQP's dependencies. In your dEQP root directory, open ‘cmd’ and run:
python external\fetch_sources.py
Get Cherry (either in ‘cmd’ or by using TortoiseGit):
git clone https://android.googlesource.com/platform/external/cherry
Set environment variable (see point 9):
Add new variable GOPATH=‘<path to cherry>
’
Build dEQP's Visual Studio files using the CMake GUI, or, in the dEQP root dir, run:
mkdir build cd build cmake ..
Note: If you have multiple versions of Visual Studio installed and you want to make sure cmake is using the correct version of Visual Studio, you can specify it by calling, for example:
cmake .. -G "Visual Studio 15 2017 Win64"
Also note: don't call ‘cmake .’ directly in the root directory. It will make things fails later on. If you do, simply erase the files created by CMake and follow the steps above.
Build dEQP:
Open <path to dEQP>\build\dEQP-Core-default.sln
in Visual Studio and Build Solution
Note: Choose a ‘Release’ build, unless you really mean to debug dEQP
Generate test cases:
mkdir <path to cherry>\data cd <path to dEQP> python scripts\build_caselists.py <path to cherry>\data
<path to cherry>\cherry\data.go
../candy-build/deqp-wgl
and replace that by <path to deqp>/build
--deqp-gl-context-type=egl
a) Assuming you already built SwiftShader in the build
folder, copy these two files:
libEGL.dll
libGLESv2.dll
From:
<path to SwiftShader>\build\Release_x64
or<path to SwiftShader>\build\Debug_x64
To:
<path to dEQP>\build\modules\gles3\Release
(Again, assuming you did a Release build at step 17)
b) Assuming you already built SwiftShader, copy and rename this file:
<path to SwiftShader>\build\Release_x64\vk_swiftshader.dll
or<path to SwiftShader>\build\Debug_x64\vk_swiftshader.dll
To:
<path to dEQP>\build\external\vulkancts\modules\vulkan\vulkan-1.dll
This will cause dEQP to load SwiftShader's Vulkan implementatin directly, without going through a system-provided loader library or any layers.
To use SwiftShader as an Installable Client Driver (ICD) instead:
<path to SwiftShader>\src\Vulkan\vk_swiftshader_icd.json
vk_swiftshader.dll
you're using is different than the one specified in src\Vulkan\vk_swiftshader_icd.json
, modify it to point to the vk_swiftshader.dll
file you want to use.Start the test server. Go to <path to cherry>
and run:
go run server.go
Open your favorite browser and navigate to localhost:8080
Get Started -> Choose Device ‘localhost’ -> Select Tests ‘dEQP-GLES3’ -> Execute tests!
dEQP contains more tests than what is expected to pass by a conformant implementation (e.g. some tests are considered too strict, or assume certain undefined behavior). The android\cts\master\gles3-master.txt text file which can be loaded in Cherry's ‘Test sets’ tab to only run the latest tests expected to pass by certified Android devices.
Differences to the steps above:
make
instead of Visual Studio.Get dEQP source code:
git clone https://android.googlesource.com/platform/external/deqp
Fetch dEQP's dependencies:
cd deqp
python external/fetch_sources.py
Run cmake and generate Makefiles:
mkdir build
cd build
cmake ..
Build dEQP:
make
Configure dEQP to use SwiftShader's Vulkan driver:
We do this by setting the VK_ICD_FILENAMES
environment variable to point to SwiftShader's vk_swiftshader_icd.json
file. Replace (or export
) $SWIFTSHADER_ROOT
to the root checkout directory of SwiftShader, and type:
export VK_ICD_FILENAMES=$SWIFTSHADER_ROOT/build/Linux/vk_swiftshader_icd.json
Run the tests:
Assuming the current working directory is still $DEQP_ROOT/build
, type:
external/vulkancts/modules/vulkan/deqp-vk
If deqp-vk
returns an error similar to:
libVulkan.cpp:69: VkResult vkCreateInstance(const VkInstanceCreateInfo*, const VkAllocationCallbacks*, VkInstance_T**): Assertion 'false' failed.
Then it is likely that your system is using a broken Vulkan loader. Grab the Vulkan SDK from here, and update LD_LIBRARY_PATH
to search the SDK's libs
directory:
export LD_LIBRARY_PATH=$VULKAN_SDK_PATH/x86_64/lib:$LD_LIBRARY_PATH