Skip to content

Tool for loading and testing native shaders translated from crosstl

Notifications You must be signed in to change notification settings

CrossGL/crossvl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation




🛠 CrossVL

CrossVL is an in-house tool for loading and testing transpiled shader files. The transpiled shader files are generated using CrossTL.

  • Metal Shaders
  • GLSL Shaders
  • HLSL Shaders
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

📊 Build Status

Windows

MacOSX

Linux

📚 Project Structure

The project is divided into two sub projects

  • VisualizerCore: Static library that contains the core functionality
  • VisualizerApp: Contains the platform independent GUI application that depends on the Core

📜 Getting started

To build the project ensure you have the following toolsets and external libraries installed.

External Dependencies

  • SDL2
  • NCurses (linux/mac only)

Clone the repository

git clone https://github.com/CrossGL/crossvl.git

Load Build Macros

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):

  • BuildAllConfigs: Builds the visualizer for both debug and release configurations
  • Clean: Cleans the xmake configs and targets
  • DeepClean: Similar to the Clean macro but also deletes the build folder
  • WatchDir: Compiles the project on every Edit and Save.
  • GenVS: Generates Visual Studio 2022 solution files
  • GenXCode: Generates XCode project files

You can run these above macros using the following command

xmake macro <macro name>

Choosing The Build Configuration

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

Compiling The Project

Using The Macros

Build all the configs

xmake macro BuildAllConfigs

Compiling Using Visual Studio

Generate VS 2022 files

xmake macro GenVS

This will generate the solution files in the vsxmake2022 folder

Compiling Using CMake

Generate CMakeLists.txt

xmake project -k cmakelists

This will generate the CMakeLists.txt in the root folder

🌈 Example Usage

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 :

animated

*Get the barrel.obj model from Output folder to test it out yourself.

🙌 Contributing

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:

  • windows
  • linux
  • macosx

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

🤝 Community

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!


Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •  

Languages