Crates.io | transhader |
lib.rs | transhader |
version | 0.1.1 |
source | src |
created_at | 2024-04-01 14:39:45.965127 |
updated_at | 2024-04-07 18:58:11.054964 |
description | Transpile shaders on the fly using procedural macros. |
homepage | |
repository | https://github.com/drafteddev/transhader |
max_upload_size | |
id | 1192583 |
size | 37,951 |
shader
)Transpile shaders from one language to another using procedural macros.
Functionality is split into different modules which allow you to transpile from/to any supported language.
The default
feature already includes all of them.
from-glsl
- Transpile OpenGL Shading Language (GLSL) Shaders.from-spv
- Transpile Standard Portable Intermediate Representation for Vulkan (SPIR-V) Shaders.from-wgsl
- Transpile Web GPU Shader Language (WGSL) Shaders.to-glsl
- Transpile shaders to OpenGL Shading Language (GLSL) Shaders.to-msl
- Transpile shaders to Metal Shading Language (MSL) Shaders.to-spv
- Transpile shaders to Standard Portable Intermediate Representation for Vulkan (SPIR-V) Shaders.to-wgsl
- Transpile shaders to Web GPU Shader Language (WGSL) Shaders.to-hlsl
- Transpile shaders to High Level Shader Language (HLSL) Shaders.Some Multi-Backend Graphics APIs (like bgfx) require shaders for every backend (GLSL for OpenGL; HLSL for D3D; MSL for Metal; SPIR-V for Vulkan; WGSL for WebGPU). You can either try to transpile your shaders using naga
during Runtime (which would affect performance) or transpile each shader using a build.rs
script.
This tool simply transpiles shaders during compile-time without any hassle.
Transhader uses naga and Rust's procedural macro system to generate optimal shader code. Configure shader transpiler options using the Rusty-Object-Notation.
Transhader is dual licensed under the MIT and Apache 2.0 licenses.