Currently we don't mix storage images and storage buffers in the same
shader. Also we don't sample textures when we use storage buffers.
In the future we need to avoid shifting descriptor sets.
This replaces all links pointing to trac with their corresponding links
to gitea. Also replace http with https while at it.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Some return values can be assigned to a `const auto`, somewhere `dir` is
mutated so the whole result has to be assigned to a non `const` variable
and once only dir is used, so structured binding isn't used there.
Instead of looking up the location of spirv-reflect for every shader,
this is now being done once and cached for all shaders. This results in
shader compilation being slightly faster.
Instead of compiling SPIR-V shaders twice, once with debug info and once
without, this uses `spirv-opt` to remove the debug info from the SPIR-V
shaders with debug info. This results in notable performance gains, as
stripping the debug info from existing shaders is much faster than
compiling them.
As a result of this change the contents of the non-debug shaders change
once. That's because shaders with debug info contain much more
instructions and therefore more result ids. Stripping the debug
info from shaders results in different result ids being used as when
generating ones without debug info. While that doesn't result in a
difference in the functionality of the shaders, it's a difference in
their binary representation, causing their content hashs and therefore
file names to change. After that one-time change the result ids are
reproducible again.
Instead of redefining the VkDescriptorType enum for every shader, only
define it once. This avoids unnecessary computation and slightly
increases performance.
At least on Linux this resulted in the help menu in Atlas not being
populated. This fixes the issue.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
b2cdb1e6b4 broke compiling of SPIR-V shaders on Windows, as the output
of `spirv-reflect` contains CRLF as line separators there. This commit
fixes that.
During the mogration to git e9d1cb6cc7 removed the
`lint-translations.sh` script which was used together with
`check_translations.py` to lint POT- and PO-files. By doing so it
removed a valuable option to find problems in translations.
This commit undos that by merging the functionality of the removed
`lint-translations.sh` and `check_translations.py` into the latter
one. The new logic is easier to maintain, produces less false-positives
and has some unit test coverage.
This drops the program name from the SPIR-V shader file name, which
allows deduplicating shaders belonging to different programs. While that
has no significant impact on compilation performance it reduces the
number of required SPIR-V shaders.
One downside this has it that it's not directly visible from the file
name of a shader anymore to which program it belongs.
GlCanvas currently doesn't support runtime selection of GDK backend [1].
Therefore to run Atlas under Wayland wxWidgets needs to be built with
GLCANVAS_EGL which is usually not the case to support X11 at the same
time.
Check if the EGL backend is available and if not and running under
Wayland force use of XWayland with the GLX backend.
[1] https://github.com/wxWidgets/wxWidgets/issues/22325Closes: #6939
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
For each program this parallelizes the generation of shaders by program
combinations. This leads to significantly faster shader generation on
systems with multiple CPU-cores. The resulting shaders are identical to
the ones prior to this change.
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.
- Small popup page accessible from the main menu via Learn to Play.
- Lets the player read through the tips with 'Previous' and 'Next' buttons.
- Tips continue to be shown on the loading screen.
-> but there without the scrolling ability.
- Added two new hotkeys for quicker tip changing (item.prev and item.next)
-> set to the left and right arrows respectively by default.
- Responsible scripts are placed in gui/reference/tips/.
- The tip text files have been moved to gui/reference/tips/texts/.
- Tip image files have been moved to art/textures/ui/tips/.
- Added a series of new sprites (textures in art/textures/ui/tipdisplay/)
-> comprises a title decoration, a bullet point sprite, and a new button
style.
This fixes -Wdeprecated-copy with FreeBSD's clang17.
This commit reverts a change from 8a32b0b3d4, where a private copy
assignment operator was deleted, whereas it was needed to explicitly
declare the copy constructor, refs #5294.
This allows build-archives.sh to fall back to vendored spirv-reflect if
it can't be found in PATH.
Also update error messages to suggest additional alternatives.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The script build-archive.sh sets a variable SPIRV_REFLECT, even respects
it if it's set in env but without support from the compile.py script for
it there isn't much point.
This commit adds support SPIRV_REFLECT in compile.py and and adds a
fallback to use vendored spirv-reflect for when the envvar is unset and
the tool can't be found in PATH
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Due to "set -e" the script terminates when the required tools aren't
found and the arguably helpful messages later on won't be printed.
Make the initial check for tools non fatal and allow for the later check
to take care of missing tools.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Currently you have to fetch translations first so they can be filtered
by build-archives.sh without the script failing.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This refactors the script for cleaning the translations to get the
same result by doing less. This is achieved by the following changes:
- Use glob-patterns for finding the files to clean more efficiently,
without the need to exclude collected files again.
- Only write files which are supposed to be modified (previously all
portable object files did get rewritten by this script, no matter if
it did change something or not).
- Stop searching for sections in files to clean up, once they are
already passed.
This commit enables a bunch of unrelated ruff rules, which only require
minimal changes to the code base to enable them.
The rules enabled by this commit are:
- check the use of datetime objects without timezone (DTZ005)
- check the performance of try-except in loops (PERF203)
- check the number of function arguments (PLR0913)
- check for mutable class defaults (RUF012)
- check for the use of secure hashing algorithms (S324)
- check for raising base exceptions (TRY002)
- check for raising other exceptions where TypeErrors should be raised
(TRY004)
This ensures the same Python target version used for `ruff format`
is used for `ruff check` as well. It also allows ruff, even if it's not
run through pre-commit, to use the correct target Python version.
Previously when checking if two SPIR-V shaders are identical the
hashs of their file content would be compared and afterwards their
(unhashed) file contents as well. Comparing the file contents isn't
necessary, as the hash function used is a cryptographic one, which
guarantees the hash can be used as a representative of the hashed data.
While the desired options for indent size and style are Python's
defaults, let's make it explicit by specifying it in the EditorConfig.
As part of this, this also removes unnecessary inline formatting options
for Python files.
This simplifies the XML parsing, by iterating over the DOM tree only
once. Curiously this doesn't result in significant performance gains.
As the keywords are now found in the order they appear in the
document instead of the order they are mentioned in messages.json, the
order of a few strings in the PO-templates changes caused by the changes
in this commit.
This simplifies the code structure, by removing the extractors package,
which only contained a single module, the extractors module. This module
is now located in the i18n_helper package.
The ini-file extractor has been broken since the transition to Python 3
and nobody noticed, because it isn't used nowadays. Therefore, let's
remove it.