Make SPIR-V file names reproducible #7068

Open
Dunedan wants to merge 1 commits from Dunedan/0ad:reproducible-shader-names into main
Member

This ensures the file names of SPIR-V program combinations and shaders
are reproducible. Up to now they only were if the order of program
combinations in the rules.json didn't change, as the file names
contained the position of the program combination in the rules.json.
With this change files names of program combinations will be named based
on the details of the combination used to create them and the file names
of shaders will be based on their content respectively.

Changing the file names avoids wrong shaders when partially rebuilding
them after a new combination for a program got added in between the
other combinations in rules.json and removes the need for keeping track
of identical shaders in the script. It's also a preparation for being
able to build shaders in parallel, while also keeping the result
reproducible.

This ensures the file names of SPIR-V program combinations and shaders are reproducible. Up to now they only were if the order of program combinations in the rules.json didn't change, as the file names contained the position of the program combination in the rules.json. With this change files names of program combinations will be named based on the details of the combination used to create them and the file names of shaders will be based on their content respectively. Changing the file names avoids wrong shaders when partially rebuilding them after a new combination for a program got added in between the other combinations in rules.json and removes the need for keeping track of identical shaders in the script. It's also a preparation for being able to build shaders in parallel, while also keeping the result reproducible.
Dunedan added 1 commit 2024-09-22 10:57:56 +02:00
Make SPIR-V file names reproducible
All checks were successful
0ad-freebsd/pipeline/pr-main This commit looks good
checkrefs / checkrefs (pull_request) Successful in 1m2s
pre-commit / build (pull_request) Successful in 1m15s
0ad-linux/pipeline/pr-main This commit looks good
0ad-windows/pipeline/pr-main This commit looks good
0ad-macos/pipeline/pr-main This commit looks good
42672442b9
This ensures the file names of SPIR-V program combinations and shaders
are reproducible. Up to now they only were if the order of program
combinations in the rules.json didn't change, as the file names
contained the position of the program combination in the rules.json.
With this change files names of program combinations will be named based
on the details of the combination used to create them and the file names
of shaders will be based on their content respectively.

Changing the file names avoids wrong shaders when partially rebuilding
them after a new combination for a program got added in between the
other combinations in rules.json and removes the need for keeping track
of identical shaders in the script. It's also a preparation for being
able to build shaders in parallel, while also keeping the result
reproducible.
Owner

Does the game know how to find them?

Does the game know how to find them?
Author
Member

Does the game know how to find them?

The file names for the programs (bloom.xml, canvas2d.xml, cas.xml, ...) stay the same. I believe that's what the game is using as entry point. What changing are the file names for the program combinations, referred by the program files and the file names for the shaders, referred by the program combination files.

> Does the game know how to find them? The file names for the programs (`bloom.xml`, `canvas2d.xml`, `cas.xml`, ...) stay the same. I believe that's what the game is using as entry point. What changing are the file names for the program combinations, referred by the program files and the file names for the shaders, referred by the program combination files.
Stan approved these changes 2024-09-22 13:01:24 +02:00
Stan left a comment
Owner

General idea sounds sane. Might want to wait for the nightly removal of shaders to be committed though, so we don't bundle useless shaders?

General idea sounds sane. Might want to wait for the nightly removal of shaders to be committed though, so we don't bundle useless shaders?
Author
Member

Yes, #7067 should be merged first.

Yes, #7067 should be merged first.
All checks were successful
0ad-freebsd/pipeline/pr-main This commit looks good
checkrefs / checkrefs (pull_request) Successful in 1m2s
Required
Details
pre-commit / build (pull_request) Successful in 1m15s
Required
Details
0ad-linux/pipeline/pr-main This commit looks good
Required
Details
0ad-windows/pipeline/pr-main This commit looks good
0ad-macos/pipeline/pr-main This commit looks good
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u reproducible-shader-names:Dunedan-reproducible-shader-names
git checkout Dunedan-reproducible-shader-names
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: 0ad/0ad#7068
No description provided.