yum-mirror/slang

Making it easier to work with shaders

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

jsmall-nvidiaFeature/test improvements (#934)2896aa39a

master
403 B23 linesraw
1// setter-method.slang
2
3//DIAGNOSTIC_TEST:SIMPLE:
4
5// Make sure we provide a user a diagnostic if they
6// try to declare a setter method without `mutating`
7// (even if we don't support `mutating` yet).
8
9struct Sphere
10{
11    float3 center;
12    float radius;
13
14    void setCenter(float3 value)
15    {
16        center = value;
17    }
18
19    void setRadius(float value)
20    {
21        this.radius = value;
22    }
23};