yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f02b08490
master
1// Test tuple comparison. 2 3//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-shaderobj -output-using-type 4//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -shaderobj -output-using-type 5//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -shaderobj -output-using-type 6//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -shaderobj -output-using-type 7 8//TEST_INPUT:ubuffer(data=[1 2 3 4], stride=4):out,name=outputBuffer 9RWStructuredBuffer<int> outputBuffer; 10 11[numthreads(1, 1, 1)] 12void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 13{ 14 var t = makeTuple(1, 2, 2.0); 15 var u = makeTuple(1, 3, 2.0); 16 17 // CHECK: 1 18 if (t._0_2 == u._0_2 && t != u) 19 outputBuffer[0] = 1; 20 21 int result = 1; 22 if (t < t) result = 0; 23 if (!(t <= t)) result = 0; 24 if (t != t) result = 0; 25 if (t > t) result = 0; 26 if (!(t >= t)) result = 0; 27 28 if (!(t < u)) result = 0; 29 if (!(t <= u)) result = 0; 30 if (!(t != u)) result = 0; 31 if (t == u) result = 0; 32 if (t > u) result = 0; 33 if (t >= u) result = 0; 34 35 if (!(u > t)) result = 0; 36 if (!(u >= t)) result = 0; 37 if (!(u != t)) result = 0; 38 if (u == t) result = 0; 39 if (u < t) result = 0; 40 if (u <= t) result = 0; 41 42 // CHECK: 1 43 outputBuffer[1] = result; 44}