yum-mirror/slang

Making it easier to work with shaders

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

Tim FoleyFix bugs related to mutating implementations of interface methods (#1461)87940a649

master
315 B26 linesraw
1// mutating-method-on-rvalue.slang
2
3//DIAGNOSTIC_TEST:SIMPLE:-target hlsl -entry main
4
5struct Counter
6{
7    int count;
8
9    [mutating] void increment() { count++; }
10
11    void bad()
12    {
13        increment();
14    }
15}
16
17cbuffer C
18{
19    Counter gCounter;
20}
21
22[shader("compute")]
23void main()
24{
25    gCounter.increment();
26}