Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTS - CI Integration #240

Draft
wants to merge 150 commits into
base: next_release
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
c29d96d
Update cts queries
UX3D-haertl Jul 15, 2024
3ee54f9
Remove glm from primitive generator
UX3D-haertl Jul 15, 2024
7081d80
Change texture generator
UX3D-haertl Jul 15, 2024
a3b9580
Remove glm
UX3D-haertl Jul 15, 2024
c48058f
Fix random transform
UX3D-haertl Jul 16, 2024
700ec37
add command to query test description & required features
UX3D-labode Jul 17, 2024
7e48731
fix build warnings
UX3D-labode Jul 17, 2024
3adc12e
avoid using existing apply_to_scene function
UX3D-labode Jul 17, 2024
be41cd6
Fix frameCompletionCallback test
UX3D-haertl Jul 17, 2024
df96ce2
Add descriptions for camera tests
UX3D-haertl Jul 17, 2024
12d5482
WIP add descriptions for frame tests
UX3D-haertl Jul 17, 2024
32d8c29
print description when rendering scenes
UX3D-labode Jul 17, 2024
95ce11b
Add description and fix for frame ID channel tests
UX3D-haertl Jul 18, 2024
427fbe9
add description to scene comparison and report
UX3D-labode Jul 19, 2024
1284f3a
Change to properties to parameters
UX3D-haertl Jul 19, 2024
d0b8f2a
add descriptions to volume, samplers, material and lights
UX3D-labode Jul 19, 2024
d1dd173
Add descriptions to geometry tests
UX3D-haertl Jul 19, 2024
09b01d8
Rename cylinder folder
UX3D-haertl Jul 19, 2024
6f37d6f
Add description to instance test
UX3D-labode Jul 22, 2024
7ac9cda
Merge remote-tracking branch 'origin/cts/descriptions' into cts/phase3
UX3D-labode Jul 22, 2024
5e4ed41
Merge remote-tracking branch 'jeff/next_release' into cts/phase3
UX3D-haertl Jul 22, 2024
b21ebcb
Add unused vertices text for all geometries
UX3D-haertl Jul 22, 2024
e54d980
Fix sphere color test. Add variants instead of permutations. Update d…
UX3D-haertl Jul 26, 2024
bb1d4ca
Merge remote-tracking branch 'jeff/next_release' into cts/descriptions
UX3D-haertl Jul 29, 2024
b0be651
Fix errors in bound checking
UX3D-haertl Jul 31, 2024
fb53d5c
Update metadata
UX3D-haertl Aug 1, 2024
06e9fbd
Load gltf via python
UX3D-haertl Aug 5, 2024
aa80296
use relative paths for glTFs
UX3D-labode Aug 14, 2024
214766b
fix gltf file parsing
UX3D-labode Aug 14, 2024
cc14345
create gltf tests
UX3D-labode Aug 16, 2024
50f97c0
cleanup gltf loading
UX3D-labode Aug 16, 2024
a75bd4e
fetch and copy glTF sample models
UX3D-labode Aug 19, 2024
39be79f
add generated glTF test cases
UX3D-labode Aug 19, 2024
628370d
fix unrelated description
UX3D-labode Aug 19, 2024
45fe702
Merge remote-tracking branch 'jeff/next_release' into cts/gltScenes
UX3D-haertl Aug 20, 2024
984471a
Use relative paths
UX3D-haertl Aug 21, 2024
000f9e2
Blacklist certain tests and fix bug in material parsing
UX3D-haertl Aug 21, 2024
904e63e
Detect srgb textures
UX3D-haertl Aug 21, 2024
4d29a5a
WIP make draco, webp, ktx optional
UX3D-labode Aug 22, 2024
26ef92b
flip all images that are rendered
UX3D-labode Aug 23, 2024
a5e419a
parse glTF camera
UX3D-labode Aug 23, 2024
fd3a576
WIP Group gltf with permutations
UX3D-haertl Aug 30, 2024
3d36c05
WIP add test permutation for glTF cameras
UX3D-labode Aug 30, 2024
babbda8
fix rendering glTF with permutations
UX3D-labode Sep 2, 2024
1f63484
add glb support to glTF test generation
UX3D-labode Sep 2, 2024
216ab21
push code missing for commit: babbda8315d79a99c661e6c4416f4ba10511b701
UX3D-labode Sep 2, 2024
4a451fc
always generate camera transform if no camera is declared in test
UX3D-labode Sep 3, 2024
d10e271
Group gltf flavors in one test file
UX3D-haertl Sep 3, 2024
297ef1c
Fix camera direction
UX3D-labode Sep 3, 2024
702ff87
Add gltf loading for permutations
UX3D-haertl Sep 3, 2024
c2f85de
Group gltf settings in object and fix permutations
UX3D-haertl Sep 4, 2024
a2b36ec
WIP Add KTX support for gltf
UX3D-haertl Sep 4, 2024
fb6a846
Fix build errors
UX3D-haertl Sep 5, 2024
a868672
Change linkage to public
UX3D-haertl Sep 5, 2024
f97487a
Merge remote-tracking branch 'upstream/next_release' into cts/gltScenes
UX3D-labode Sep 5, 2024
0852296
Fix permutations
UX3D-haertl Sep 5, 2024
fd5e793
Reset gltf data
UX3D-haertl Sep 5, 2024
f413452
Merge branch 'cts/gltScenes' into cts/KTX
UX3D-haertl Sep 5, 2024
4dda3cb
Extract component number
UX3D-haertl Sep 5, 2024
978cd3f
Set width and height
UX3D-haertl Sep 5, 2024
9868691
Remove wrong release
UX3D-haertl Sep 5, 2024
35d5a32
Merge branch 'cts/gltScenes' into cts/KTX
UX3D-haertl Sep 5, 2024
df64697
Set n correctly
UX3D-haertl Sep 5, 2024
e4a431d
Set compile definitions to private
UX3D-haertl Sep 5, 2024
6e67880
add default constructor to SceneGeneratorWrapper with debug-wrapped s…
UX3D-labode Sep 5, 2024
f68cbd3
Fix fnmatch error on python 3.12
UX3D-haertl Sep 6, 2024
cec0e4b
WIP successfully run wrapped device, printing req. features
UX3D-labode Sep 6, 2024
5ced9e1
Parse required features and add to json
UX3D-labode Sep 9, 2024
6af8990
rename and update comments
UX3D-labode Sep 9, 2024
26990da
Remove setting default ambient/background values in renderer
UX3D-labode Sep 9, 2024
45894fe
Update glTF tests with required features
UX3D-labode Sep 9, 2024
946b806
Merge remote-tracking branch 'origin/cts/gltScenes' into cts/gather_u…
UX3D-labode Sep 9, 2024
26b1b04
Fix releasing of debug device
UX3D-labode Sep 10, 2024
2b1f723
Fix wrapped device not being initialized as nullptr
UX3D-labode Sep 10, 2024
fc45962
WIP add glTF light parsing
UX3D-labode Sep 10, 2024
9c4b7f6
Merge branch 'next_release' into cts/gltScenes
UX3D-haertl Sep 11, 2024
aead8e5
Merge branch 'cts/gltScenes' into cts/KTX
UX3D-haertl Sep 11, 2024
d8a22bb
Fix build error
UX3D-haertl Sep 11, 2024
af2b275
Merge branch 'cts/gltScenes' into cts/KTX
UX3D-haertl Sep 11, 2024
ff653f7
Support ANARI_EXT_SAMPLER_COMPRESSED_FORMAT_BC67
UX3D-haertl Sep 11, 2024
947c8dc
Add pbr extensions sheen, specular, clearcoat
UX3D-labode Sep 11, 2024
b47b313
Add fallback and error messages
UX3D-haertl Sep 12, 2024
419b2c1
Add pbr extensions transmission, ior, volume, iridescence
UX3D-labode Sep 12, 2024
4c8977d
Change cmake options
UX3D-haertl Sep 12, 2024
d4f3fdb
Merge remote-tracking branch 'origin/cts/gltScenes' into cts/KTX
UX3D-haertl Sep 13, 2024
87d3d84
add emissive and emissiveStrength
UX3D-labode Sep 13, 2024
2fe4cfd
Do not set zero verticies
UX3D-haertl Sep 13, 2024
474e2e6
Merge branch 'cts/KTX' into cts/gltScenes
UX3D-haertl Sep 13, 2024
2721aec
add alpha, normal and occlusion
UX3D-labode Sep 13, 2024
ed7a414
prioritize default material pbr else matte
UX3D-labode Sep 13, 2024
e20e70b
Fix checking and removing PBR material feature
UX3D-labode Sep 13, 2024
20a1054
Update glTF test cases
UX3D-labode Sep 13, 2024
faf0ccc
matte materials should never be listed in required features
UX3D-labode Sep 13, 2024
ec8115c
WIP texture transform
UX3D-haertl Sep 13, 2024
1381f70
Fix orhtographic camera
UX3D-haertl Sep 16, 2024
0affb90
Adjust light test to new camera position
UX3D-haertl Sep 16, 2024
0e6de48
Do not submit geometry with empty vertices
UX3D-haertl Sep 16, 2024
ba5784b
Fix texture transform
UX3D-haertl Sep 16, 2024
d225b2d
Fix texture swizzles
UX3D-haertl Sep 17, 2024
8ed481c
Set swizzel for normal and occlusion
UX3D-haertl Sep 17, 2024
ba9a951
Fix hdri test
UX3D-haertl Sep 18, 2024
22c3a8f
Fix hdri direction test
UX3D-haertl Sep 18, 2024
d92d80e
Only print warning for empty vertices if they are required
UX3D-haertl Sep 18, 2024
dd05558
remove triangle and perspective camera features from test requirements
UX3D-labode Sep 25, 2024
f4ede68
Update readme
UX3D-labode Sep 26, 2024
396d0fb
Also check for currently not tested features
UX3D-labode Sep 27, 2024
ec478c2
WIP render glTF images with given camera aspect ratios
UX3D-labode Sep 27, 2024
45a5e6a
WIP pass image render size to python
UX3D-labode Sep 30, 2024
a71c781
fix order of width and height for rendering and image saving
UX3D-labode Sep 30, 2024
077570f
show images in report with correct aspect ratio
UX3D-labode Sep 30, 2024
6502242
remove indent in python file
UX3D-labode Sep 30, 2024
241f8de
Add note to report that matte was used instead of pbr
UX3D-labode Oct 1, 2024
e216b1c
Add mikktspace lib
UX3D-labode Oct 2, 2024
bda3ec6
use matte default material if pbr is not supported
UX3D-labode Oct 2, 2024
1c98931
WIP add mikktspace tangent generation
UX3D-labode Oct 2, 2024
2b6d1b1
Add tangent generation
UX3D-labode Oct 2, 2024
8136890
Control tangent generation from python side
UX3D-labode Oct 4, 2024
c5997a2
Set directional light irradiance from glTF
UX3D-labode Oct 4, 2024
e6a247c
run cts in github actions
UX3D-labode Oct 4, 2024
9433760
split github workflow into two cts tests
UX3D-labode Oct 4, 2024
4be97da
turn off cts glTF support for github runner
UX3D-labode Oct 8, 2024
6001c25
WIP fix build issue on runner
UX3D-labode Oct 8, 2024
2d27c94
allow c files in anari_test_scenes
UX3D-labode Oct 8, 2024
298245f
Fix adding mikktspace lib
UX3D-labode Oct 8, 2024
7caa466
Add os dependent pipx installation
UX3D-labode Oct 8, 2024
128dce4
change github action path to cts directory
UX3D-labode Oct 8, 2024
2f7b2d2
CI build anari backend
UX3D-labode Oct 8, 2024
a71f3b8
Add debug messages to copy step
UX3D-labode Oct 9, 2024
13624b5
fix operator issue by explicitly getting float from json
UX3D-labode Oct 9, 2024
f8b84b8
set pythonpath for github actions
UX3D-labode Oct 9, 2024
af64e47
fix pythonpath
UX3D-labode Oct 9, 2024
041ef37
github actions add debug output
UX3D-labode Oct 9, 2024
ef75cb3
fix typo
UX3D-labode Oct 9, 2024
fca536e
Fix missing function argument when creating glTF test cases
UX3D-labode Oct 9, 2024
9e2fec7
fix macos pipx installation
UX3D-labode Oct 9, 2024
94e1b89
fix unicode depiction on windows runner
UX3D-labode Oct 9, 2024
7542f84
use utf-8 when opening files in python
UX3D-labode Oct 9, 2024
886934c
remove option that does not exist on MacOS
UX3D-labode Oct 9, 2024
129f77f
Use python3 command on linux/macos runners
UX3D-labode Oct 9, 2024
e5c5415
Remove unicode test asset from cts
UX3D-labode Oct 9, 2024
cddda37
fix missing python package in final step
UX3D-labode Oct 9, 2024
13f4649
run script directly from poetry
UX3D-labode Oct 10, 2024
04b06d1
do not use poetry shell
UX3D-labode Oct 10, 2024
4d10f37
deactivate fail-fast for testing
UX3D-labode Oct 10, 2024
30a5779
Fix formatting of strings in python
UX3D-labode Oct 10, 2024
86aff44
fix pythonpath differences between OSes
UX3D-labode Oct 10, 2024
e32d1c6
run cts from install folder in github Runners
UX3D-labode Oct 10, 2024
c6864d2
remove variable formatting that causes issues on Windows runner
UX3D-labode Oct 10, 2024
e552eb1
remove x64-Debug/Release folder in windows paths
UX3D-labode Oct 10, 2024
eaecf64
Update glTF test cases
UX3D-labode Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 74 additions & 3 deletions .github/workflows/anari_sdk_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ on:
pull_request:
branches: [ main, next_release ]

env:
ANARI_LIBRARY: helide

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
config: [Release, Debug]
env:
ANARI_LIBRARY: helide

steps:
- uses: actions/checkout@v3
Expand All @@ -36,6 +36,7 @@ jobs:
-DBUILD_REMOTE_DEVICE=${{ matrix.os == 'ubuntu-latest' }}
-DBUILD_TESTING=ON
-DBUILD_VIEWER=OFF
-DCTS_ENABLE_GLTF=OFF

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.config }} --target install
Expand All @@ -51,3 +52,73 @@ jobs:
- name: Tutorial Tests
working-directory: ${{github.workspace}}/build
run: ctest -R anariTutorial -C ${{ matrix.config }}

- name: Build CTS
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.config }} --target anariCTSBackend

- name: Debug Output Windows
working-directory: ${{github.workspace}}/build/install/
if: ${{ matrix.os == 'windows-latest' }}
run: |
echo "Directories in build/install/:"
ls

- name: CTS test case creation Linux
working-directory: ${{github.workspace}}/build/install/share/anari/cts
env:
PYTHONPATH: ${{github.workspace}}/build/install/lib
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt install pipx
pipx ensurepath
pipx install poetry
poetry install
poetry run python3 ./createTestCasesFromGltf.py

- name: CTS test case creation Windows
working-directory: ${{github.workspace}}/build/install/share/anari/cts
env:
PYTHONPATH: ${{github.workspace}}/build/install/bin
if: ${{ matrix.os == 'windows-latest' }}
run: |
python -m pip install --user pipx
python -m pipx ensurepath
pipx install poetry
poetry install
poetry run python ./createTestCasesFromGltf.py

- name: CTS test case creation MacOS
working-directory: ${{github.workspace}}/build/install/share/anari/cts
env:
PYTHONPATH: ${{github.workspace}}/build/install/lib
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install pipx
pipx ensurepath
pipx install poetry
poetry install
poetry run python3 ./createTestCasesFromGltf.py

- name: CTS create reference data Linux
working-directory: ${{github.workspace}}/build/install/share/anari/cts
env:
PYTHONPATH: ${{github.workspace}}/build/install/lib
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
poetry run python3 ./createReferenceData.py

- name: CTS create reference data Windows
working-directory: ${{github.workspace}}/build/install/share/anari/cts
env:
PYTHONPATH: ${{github.workspace}}/build/install/bin
if: ${{ matrix.os == 'windows-latest' }}
run: |
poetry run python ./createReferenceData.py

- name: CTS create reference data MacOS
working-directory: ${{github.workspace}}/build/install/share/anari/cts
env:
PYTHONPATH: ${{github.workspace}}/build/install/lib
if: ${{ matrix.os == 'macos-latest' }}
run: |
poetry run python3 ./createReferenceData.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ cts/*.exp
cts/*.lib
cts/*.ilk
cts/*.pdb
cts/glTF-Sample-Assets
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
option(BUILD_SHARED_LIBS "Build shared libraries instead of static" ON)
option(BUILD_TESTING "Build tests for CTest" ON)
# ANARI specific options

option(BUILD_CTS "Build cts toolkit" ON)
cmake_dependent_option(CTS_ENABLE_GLTF "Enable glTF support for cts" ON "BUILD_CTS" ON)
option(USE_DRACO "Use draco when loading glTF files" OFF)
option(USE_WEBP "Use webp when loading glTF files" OFF)
option(USE_KTX "Use ktx when loading glTF files" OFF)

if (CTS_ENABLE_GLTF)
set(USE_KTX ON)
set(USE_WEBP ON)
set(USE_DRACO ON)
endif()

option(BUILD_EXAMPLES "Build example applications and example device" ON)
cmake_dependent_option(BUILD_VIEWER
"Build interactive viewer app (requires GLFW)"
Expand All @@ -68,12 +80,19 @@ cmake_dependent_option(VIEWER_ENABLE_GLTF
"BUILD_VIEWER"
OFF
)
if (VIEWER_ENABLE_GLTF)
set(USE_WEBP ON)
set(USE_DRACO ON)
endif()
cmake_dependent_option(VIEWER_ENABLE_KTX
"Enable KTX support in viewer"
OFF
"BUILD_VIEWER"
OFF
)
if (VIEWER_ENABLE_KTX)
set(USE_KTX ON)
endif()

## The generate_all targets collects all offline code generation targets

Expand Down
22 changes: 22 additions & 0 deletions cts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

cmake_minimum_required(VERSION 3.1)

# Fix "DOWNLOAD_EXTRACT_TIMESTAMP" warning
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()

include(FetchContent)

if (TARGET anari)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake)
endif()
Expand Down Expand Up @@ -69,6 +76,17 @@ if (CTS_DEV AND NOT BUILD_SHARED_LIBS)
)
endif()

message("Fetching glTF Sample Models")
FetchContent_Declare(glTFSampleAssets
GIT_REPOSITORY https://github.com/KhronosGroup/glTF-Sample-Assets.git
GIT_TAG 754a32a333b27698b6c36d8bec8ff7ed5f729538)
FetchContent_MakeAvailable(glTFSampleAssets)

message("Copying glTF Sample Models")
file(GLOB GLTF_SAMPLE_ASSETS_FILES ${gltfsampleassets_SOURCE_DIR}/Models/*)
list(FILTER GLTF_SAMPLE_ASSETS_FILES EXCLUDE REGEX ".*Unicode❤♻Test")
file(COPY ${GLTF_SAMPLE_ASSETS_FILES} DESTINATION ${CMAKE_CURRENT_LIST_DIR}/gltf-Sample-Assets)

## Installation ##

# .pyd files are considered library files
Expand All @@ -95,3 +113,7 @@ install(FILES ${python_files} ${CMAKE_CURRENT_LIST_DIR}/default_test_scene.json
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/test_scenes
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/anari/cts
)

install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/gltf-Sample-Assets
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/anari/cts
)
17 changes: 14 additions & 3 deletions cts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,23 @@ It contains the following features:
- Verification of object/parameter info metadata
- Verification of known object properties
- List core extensions implemented by a device
- Create pdf report
- Create a pdf report

## Requirements

The project uses poetry to manage package versions. If using poetry is not wanted, one can manually install the dependencies specified in [pyproject.toml](pyproject.toml).
### ANARI Feature Support

Any libraries/devices being tested need to at least support the following features:

- ANARI_KHR_MATERIAL_MATTE
- ANARI_KHR_GEOMETRY_TRIANGLE
- ANARI_KHR_CAMERA_PERSPECTIVE
- ANARI_KHR_RENDERER_BACKGROUND_COLOR
- ANARI_KHR_RENDERER_AMBIENT_LIGHT

### Software Dependencies

This project uses poetry to manage package versions. To bypass using poetry the packages listed in [pyproject.toml](pyproject.toml) can be installed manually.

- Your ANARI library files copied into this folder
- [Python 3.9+](https://www.python.org/downloads/)
Expand Down Expand Up @@ -154,7 +166,6 @@ Here is the [sphere test file](test_scenes/primitives/sphere/sphere.json) as an
- `spatial_field_dimensions`: A 3-integer array, describing the dimensions of all spatial fields in this test. If no spatial field is defined in `anariObjects`, a default one will be used.
- `frameCompletionCallback`: When set to `true`, checks if `ANARI_KHR_FRAME_COMPLETION_CALLBACK` works correctly. Renders a green image on success and a red image otherwise.
- `progressiveRendering`: When set to `true`, checks if `ANARI_KHR_PROGRESSIVE_RENDERING` works correctly. Renders a green image if more then 10 pixels differ from the previous rendering and a red image otherwise.
- `camera_generate_transform`: Enables automatic adaptation of the camera position to the scene.
- `anari_objects`: This JSON object can be used to set generic parameters for all ANARI objects except World. It holds arrays that each have their type name as their key. Each array should only have one element. This array contains objects with parameters for each ANARI object. The parameter `subtype` is mandatory for all object types that define it. `null` can be used to reset/use the default of a parameter (useful for permutations). To set a parameter to a reference to another object, use the `ref_` prefix, then add the type and index, e.g. `ref_sampler_0`. All other `sceneParameters` take precedence over the ones set using the generic `anari_objects`. This also implies that for geometries, subtypes can not be mixed and `subtype` in `anariObjects` need to match `geometrySubtype`. Additionally, if `instances` are used no objects are added to the world despite the instances. There is no need to create e.g. a default `surface` to display materials or geometry. If an object is missing, a default object is used instead. To set `Array1D` or `Array2D` parameters, the value needs to be a JSON object containing the type as key together with its value, e.g. `{"Array1D": [0, 1, 2, 3]}`.
- `simplified_permutations`: When set to `true`, only the first value of each permutation list is used with permutations of other parameters, therefore reducing the amount of tests to N_0 + N_1 + ... instead of a cartesian product
- `permutations` and `variants`: These specify scene parameters where different values should be tested. Therefore, these JSON objects contain the name of a scene parameter and a list of values for each of them. The permutations specify changes which result in a different outcome (e.g. 1 or 16 primitives). The variants should not change the outcome, therefore only one reference rendering is needed for these (e.g. the soup and indexed variants should look the same). The cartesian product is performed for all parameters. In the current example this results in four test images: 1 primitive + soup, 1 primitive + indexed, 16 primitives + soup, 16 primitives + indexed; As well as two reference images: 1 primitive (soup or indexed), 16 primitives (soup or indexed). To permutate a parameter in an ANARI object, the object needs to be defined in `anariObjects` without the parameter. In the permutation or variant object a JSON pointer e.g. `"/anari_objects/material/0/color"` should be used as key as seen in the example.
Expand Down
4 changes: 3 additions & 1 deletion cts/copy_post_build.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
message("Copying files to ${CMAKE_CURRENT_LIST_DIR}")

file (GLOB pyd_files "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BUILD_CONFIG_DIR}/*.pyd")
file (GLOB example_lib "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BUILD_CONFIG_DIR}/anari_library_${REFERENCE_LIB}*")
file (GLOB debug_lib "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BUILD_CONFIG_DIR}/anari_library_debug*")


message("files: ${pyd_files}")
file(COPY ${pyd_files} ${example_lib} ${debug_lib} DESTINATION "${CMAKE_CURRENT_LIST_DIR}")
22 changes: 16 additions & 6 deletions cts/createReferenceData.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import argparse
import math


def writeMetaData(sceneGenerator, scene_location, permutationString):
original_json = {}
with open(scene_location, "r") as scene_file:
with open(scene_location, "r", encoding="utf-8") as scene_file:
original_json = json.load(scene_file)
metaData = {"bounds": {}}
bounds = sceneGenerator.getBounds()
Expand All @@ -23,19 +24,19 @@ def writeMetaData(sceneGenerator, scene_location, permutationString):
if "metaData" not in original_json:
original_json["metaData"] = {}
original_json["metaData"][permutationString] = metaData
with open(scene_location, "w") as scene_file:
with open(scene_location, "w", encoding="utf-8") as scene_file:
json.dump(original_json, scene_file, indent=2)


def cleanMetaData(
_lib, _dev, _ren, scene_location, _test_name, _permutationString, _variantString
):
original_json = {}
with open(scene_location, "r") as scene_file:
with open(scene_location, "r", encoding="utf-8") as scene_file:
original_json = json.load(scene_file)
if "metaData" in original_json:
del original_json["metaData"]
with open(scene_location, "w") as scene_file:
with open(scene_location, "w", encoding="utf-8") as scene_file:
json.dump(original_json, scene_file, indent=2)


Expand Down Expand Up @@ -68,10 +69,17 @@ def createReferenceData(
parser.add_argument("-r", "--renderer", default="default")
parser.add_argument("-t", "--test_scenes", default="test_scenes")
parser.add_argument("--ignore_features", action="store_true")
parser.add_argument("--no_tangent_generation", action="store_true")

args = parser.parse_args()
cts.apply_to_scenes(
cleanMetaData, args.library, args.device, args.renderer, args.test_scenes, True, not args.ignore_features
cleanMetaData,
args.library,
args.device,
args.renderer,
args.test_scenes,
True,
not args.ignore_features,
)
cts.apply_to_scenes(
createReferenceData,
Expand All @@ -80,5 +88,7 @@ def createReferenceData(
args.renderer,
args.test_scenes,
True,
not args.ignore_features
not args.ignore_features,
True,
not args.no_tangent_generation,
)
Loading
Loading