osmesa: Enable Mesa/OSMesa rendering for mac
This commit enables local running of the renderdiff tests and also for github workflows.
This commit is contained in:
@@ -46,7 +46,12 @@ def render_test(gltf_viewer, test_config, output_dir,
|
||||
for backend in test_config.backends:
|
||||
env = None
|
||||
if backend == 'opengl' and opengl_lib and os.path.isdir(opengl_lib):
|
||||
env = {'LD_LIBRARY_PATH': opengl_lib}
|
||||
env = {
|
||||
'LD_LIBRARY_PATH': opengl_lib,
|
||||
|
||||
# for macOS
|
||||
'DYLD_LIBRARY_PATH': opengl_lib,
|
||||
}
|
||||
|
||||
for model in test.models:
|
||||
model_path = test_config.models[model]
|
||||
|
||||
@@ -18,11 +18,19 @@ OUTPUT_DIR="$(pwd)/out/renderdiff_tests"
|
||||
RENDERDIFF_TEST_DIR="$(pwd)/test/renderdiff"
|
||||
TEST_UTILS_DIR="$(pwd)/test/utils"
|
||||
MESA_DIR="$(pwd)/mesa/out/"
|
||||
MESA_LIB_DIR="${MESA_DIR}/lib/x86_64-linux-gnu"
|
||||
|
||||
os_name=$(uname -s)
|
||||
if [[ "$os_name" == "Linux" ]]; then
|
||||
MESA_LIB_DIR="${MESA_DIR}lib/x86_64-linux-gnu"
|
||||
elif [[ "$os_name" == "Darwin" ]]; then
|
||||
MESA_LIB_DIR="${MESA_DIR}lib"
|
||||
else
|
||||
echo "Unsupported platform for renderdiff tests"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function prepare_mesa() {
|
||||
if [ ! -d ${MESA_LIB_DIR} ]; then
|
||||
rm -rf mesa
|
||||
bash ${TEST_UTILS_DIR}/get_mesa.sh
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user