yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
9ec6b9168
master
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUFFER):-shaderobj -vk 2//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUFFER):-shaderobj 3 4struct ExplicitCtor 5{ 6 int x; 7 int y; 8 __init(int x) 9 { 10 this.x = x; 11 this.y = x + 5; 12 } 13} 14 15//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer 16RWStructuredBuffer<int> outputBuffer; 17void test() 18{ 19 // case 1: initialized with synthesized ctor call using legacy logic to form arguments, 20 // and `c1` is now `{0,0}`. 21 ExplicitCtor c1 = {4}; 22 23 // BUFFER: 4 24 outputBuffer[0] = c1.x; 25 // BUFFER-NEXT: 9 26 outputBuffer[1] = c1.y; 27 28 29 ExplicitCtor c2 = ExplicitCtor(10); 30 31 // BUFFER: A 32 outputBuffer[2] = c2.x; 33 // BUFFER-NEXT: F 34 outputBuffer[3] = c2.y; 35} 36 37[shader("compute")] 38void computeMain() 39{ 40 test(); 41}