ShaderLang
ShaderLang copied to clipboard
NZSL (Nazara Shading Language) repository - A shader language inspired by Rust and C++ which compiles to GLSL or SPIRV (without any additional dependency)
Is it possible to define recursive functions in NZSL? I normally use [macro expansion](https://stackoverflow.com/a/77470186/975097) to define recursive functions in shading languages, but I wish they had built-in support for recursion.
Add support for bit operators (&, |, ~, ) on vector of integers. 1. [ ] Implement bitwise operators to the `nzsl::Vector` class (component-wise), beware of right shifting on integer...
Currently, constant propagation on binary expressions requires to know both operands, but there are cases than can be optimized when knowing only one operand: - `a + 0` -> `a`...
Currently, the library part of NZSL cannot be used in other languages due to its C++ API. It would be a good thing to provide a C wrapper, even minimalistic,...
Currently, only builtin types (bool, f32, i32, u32) and f32/i32 vectors of size from 2 to 4 are handled as constants values, which allows constant propagation, to set them from...
One drawback of NZSL is its massive use of options, which prevent the early generation of GLSL and SPIR-V. Something we could do to help with this is to give...
Currently, type deduction only occurs for variable declarations: ```rs let x = 42.0; ``` is equivalent to ```rs let x: f32 = 42.0; ``` It would be great to allow...
Currently, options are treated like unknown values, or even unknown types. However, it would be pretty simple to handle cases where the value is known and validation / optimization can...
Currently, this code compiles correctly and shouldn't: ``` fn get_value() -> i32 { return 42.666; //< should trigger an error } ``` Also ``` fn get_value() -> i32 { return;...
It would be nice to support a `match` statement, but I'm unsure about the syntax that should be used. ```rs let x: i32; let result: i32; match (x) { //<...