yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f02b08490
master
1//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain 2//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -emit-spirv-directly 3//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-cpu -compute -entry computeMain 4//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-dx12 -compute -entry computeMain 5 6#pragma warning(disable:30816) 7 8 9//TEST_INPUT:ubuffer(data=[0 0], stride=4):out,name=outputBuffer 10RWStructuredBuffer<int> outputBuffer; 11 12struct DefaultStructWithInit_base 13{ 14 int data0 = 3; 15 int data1 = 0; 16}; 17 18struct DefaultStructWithInit : DefaultStructWithInit_base 19{ 20 __init() 21 { 22 data1 = 3; 23 } 24}; 25 26[numthreads(1, 1, 1)] 27void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID) 28{ 29 DefaultStructWithInit withInit = DefaultStructWithInit(); 30 // BUF: 1 31 outputBuffer[0] = true 32 && withInit.data0 == 3 33 && withInit.data1 == 3 34 ; 35}