支持 Shader Defines
Open
- Dominant language
- TypeScript
- Stars
- 33
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
目前为 WGSL 提供 Shader Chunks 模块化功能用法如下:
```ts
const compiler = device['WGSLComposer'];
const code = compiler.wgsl_compile(wgsl);
```
```wgsl
#define_import_path my_module
fn my_func() -> f32 {
return 1.0;
}
```
但还不支持 shader defines
Contributor guide
Research direction
Start at the WGSLComposer entry point and its wgsl_compile call, then compare the existing #define_import_path shader-chunk handling with the requested shader-defines behavior. Clarify the expected define syntax and substitution rules before implementing support, and add coverage showing that defines are processed correctly during compilation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100