yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Yong HeAdd implicit cast for generic vector types. (#5413)faa7d6ba4

master
475 B17 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target spirv
2
3// CHECK: OpEntryPoint
4
5struct SomeStruct<Real : __BuiltinFloatingPointType> {
6    vector<Real, 3> color;
7    __init() {
8        vector<float, 3> _color = vector<float, 3>(0);
9        color = _color; // error 30019: expected an expression of type 'vector<Real,3>', got 'vector<float,3>'
10        color = vector<Real, 3>(_color); // also does not work
11    }
12}
13
14[numthreads(1, 1, 1)]
15void computeMain() {
16    SomeStruct<float> s;
17}