@@ -7,11 +7,72 @@ machines. To perform software rasterization, these scripts are centered around [
77rasterizers, but nothing bars us from using another rasterizer like [ SwiftShader] . Additionally,
88we should be able to use GPUs where available (though this is more of a future work).
99
10- The script ` run .py` contains the core logic for taking input parameters (such as the test
11- description file) and then running gltf_viewer to produce the results .
10+ The script ` render .py` contains the core logic for taking input parameters (such as the test
11+ description file) and then running gltf_viewer to produce the renderings .
1212
1313In the ` test ` directory is a list of test descriptions that are specified in json. Please see
1414` sample.json ` to parse the structure.
1515
16+ ## Running the test locally
17+ - To run the same presbumit as [ ` test-renderdiff ` ] [ presubmit-renderdiff ] , you can do
18+ ```
19+ bash test/renderdiff/test.sh
20+ ```
21+ - This script will generate the renderings based on the current state of your repo.
22+ Additionally, it will also compare the generated images with corresponding images in the
23+ golden repo.
24+ - To just render without running the test, you could use the following script
25+ ```
26+ bash test/renderdiff/generate.sh
27+ ```
28+
29+ ## Update the golden images
30+ The golden images are stored in a github repository: https://github.com/google/filament-assets .
31+ Filament team members should have access to write to the repository. A typical flow for updating
32+ the goldens is to upload your changed images into ** branch** of ` filament-assets ` . This branch is
33+ paired with a PR or commit on the ` filament ` repo.
34+
35+ As an example, imagine I am working on a PR, and I've uploaded my change, which is in a branch
36+ called ` my-pr-branch ` , to ` filament ` . This PR requires updating the golden. We would do it
37+ in the following fashion
38+
39+ ### Using a script to update the golden repo
40+
41+ - Run interactive mode in the ` update_golden.py ` script.
42+ ```
43+ python3 test/renderdiff/src/update_golden.py
44+ ```
45+ - This will guide you through a series of steps to push the changes to a remote branch
46+ on ` filament-assets ` .
47+
48+ ### Manually updating the golden repo
49+
50+ - Check out the golden repo
51+ ```
52+ git clone git@github.com:google/filament-assets.git
53+ ```
54+ - Create a branch on the golden repo
55+ ```
56+ cd filament-assets
57+ git switch -c my-pr-branch-golden
58+ ```
59+ - Copy the new images to their appropriate place in ` filament-assets `
60+ - Push the ` filament-assets ` working branch to remote
61+ ```
62+ git push origin my-pr-branch-golden
63+ ```
64+ - In the commit message of your working branch on ` filament ` , add the following line
65+ ```
66+ RDIFF_BBRANCH=my-pr-branch-golden
67+ ```
68+ ### Manually updating the golden repo
69+
70+ Doing the above has multiple effects:
71+ - The presubmit test [ ` test-renderdiff ` ] [ presubmit-renderdiff ] will test against the provided
72+ branch of the golden repo (i.e. ` my-pr-branch-golden ` ).
73+ - If the PR is merged, then there is another workflow that will merge ` my-pr-branch-golden ` to
74+ the ` main ` branch of the golden repo.
75+
1676[ Mesa ] : https://docs.mesa3d.org
17- [ SwiftShader ] : https://github.com/google/swiftshader
77+ [ SwiftShader ] : https://github.com/google/swiftshader
78+ [ presubmit-renderdiff ] : https://github.com/google/filament/blob/e85dfe75c86106a05019e13ccdbef67e030af675/.github/workflows/presubmit.yml#L118
0 commit comments