Tool for loading and testing native shaders translated from crosstl
CrossVL is an in-house tool for loading and testing transpiled shader files. The transpiled shader files are generated using CrossTL.
Platform | DX11 | DX12 | OpenGL | Metal | Vulkan |
---|---|---|---|---|---|
Windows | In Progress | Not Implemented | In Progress | Not Supported | Not Implemented |
Linux | Not Supported | Not Supported | In Progress | Not Supported | Not Implemented |
MacOSX | Not Supported | Not Supported | Not Supported | In Progress | Not Implemented |
The project is divided into two sub projects
To build the project ensure you have the following toolsets and external libraries installed.
git clone https://github.com/CrossGL/crossvl.git
The repo comes with a couple helper xmake macros. Load these macros by running the LoadMacros.bat or LoadMacros.sh file depending on the OS. You only need to run this bat script only once, or if you delete the generated .xmake
folder.
After running the script the following macros will be imported (case insensitive):
You can run these above macros using the following command
xmake macro <macro name>
Before compiling the project you can also set the build config
To make use of the debug config
xmake f -m debug
To make use of the release config
xmake f -m release
Build all the configs
xmake macro BuildAllConfigs
Generate VS 2022 files
xmake macro GenVS
This will generate the solution files in the vsxmake2022 folder
Generate CMakeLists.txt
xmake project -k cmakelists
This will generate the CMakeLists.txt in the root folder
To test your own .obj
models, place the model file in the Samples/ModelLoading/Assets/
directory. Then, update the filename in ModelLoading.cpp
to match your .obj
file.
Here barrel.obj
model is used to show as an example, the output would look like :
*Get the barrel.obj
model from Output folder to test it out yourself.
When contributing to the project. Ensure the project passes the compilation test locally on your PC.
xmake rhitest -p <platform>
Where the valid platforms are:
This will run a series of matrix test for each valid API for that platform (e.g. for macosx it will test compilation for metal and vulkan). Make sure to test in both debug and release build configs.
The complete testing process should look as follows (using windows as example):
xmake f -m debug
xmake rhitest -p windows
xmake f -m release
xmake rhitest -p windows
The expected output should be such that all projects compile and link successfully
Stay connected and follow our latest updates and announcements.
If you like our work, please help us by starring the repo 🌟 Feel free to leave us feedback on Discord if you have any suggestions. See you there!