AZSLc is a stand-alone command line compiler for the Amazon Shading Language. It converts Amazon Shading Language (AZSL) shaders to High Level Shading Language Shader Model 6+ (HLSL) shaders.
For more information, see (https://o3de.org/docs/atom-guide/dev-guide/shaders/)
AZSLc is a compiler for the Amazon Shading Language, which is a thin extension of HLSL. It unifies resource bindings across all supported graphics hardware using binding strategy which models modern API such as DirectX 12 and Vulkan. Future plans include support for interfaces, generics and associated types and aims to bring the shader languages closer to modern programming languages while still allowing users to write shaders in plain HLSL code.
Currently supported graphics API are:
Make sure Python 3.7+ is in your $PATH
(as 'python'), and run:
python .\test.and.py
or
python .\test.and.py --dev D:\o3de
(D:\o3de
should be replaced with your local path for the O3DE root directory)
The script will tell you the prerequisites per platform, which are also detailed below. If all prerequisites are installed, the script will make, build and test the shader compiler.
pip install pyyaml
) - only required to run the testspip install pyyaml
) - only required to run the testspip install pyyaml
) - only required to run the testsregenerate_azsl_antlr.bat
script under src
folder, it will regenerate the files under src/generated
.
You'll probably need to regenerate the AzslcPredefinedTypes.h
header file if you made a change to the lexer keywords. For that purpose, execute regenerate-predefined-types.bat (or simply directly python exportKeywords.py
if not on windows)
After installing the prerequisites, run either command from a console:
build_win.bat Debug
build_win.bat Release
You can find the binary azslc.exe
in the bin
directory.
After installing the prerequisites, run from the terminal:
./prepare_solution_darwin.sh
You can find the binaries azslc
in the bin/darwin/release
and the bin/darwin/debug
directories.
After installing the prerequisites, run from the terminal:
./prepare_solution_linux.sh
You can find the binaries azslc
in the bin/linux/release
and the bin/linux/debug
directories.
The tests
folder includes all the unit and integration tests for AZSLc.
Tests require Python 3.7 to run. And pyyaml for a complete run. (do pip install pyyaml)
For Windows, run either launch_tests.bat
or launch_tests_debug.bat
to launch the test suite.
For MacOSX, run either launch_tests.sh
or launch_tests_debug.sh
to launch the test suite.
For terms please see the LICENSE*.TXT file at the root of this distribution.