yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
afb1405bf
master
1//TEST:SIMPLE(filecheck=CHECK): -target spirv 2 3struct Test { 4 RWStructuredBuffer<int> val; 5 __subscript(int x, int y)->int 6 { 7 get { return val[x * 3 + y]; } 8 set { val[x * 3 + y] = newValue; } 9 } 10} 11Test test; 12 13[numthreads(1, 1, 1)] 14void computeMain() 15{ 16 // test[0,0] is not an l-value because `test` is a read-only parameter, 17 // and the `set` accessor is by-default `mutating`, which means that it is 18 // only callable when `test` itself is l-value. 19 20 // CHECK: ([[# @LINE+1]]): error 30011 21 test[0,0] = 1; 22 23}