yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f7d54af67
master
1// fmod.slang 2 3// Ensure that HLSL `fmod` works and produces 4// expected output on Vulkan/GLSL. 5 6//TEST(compute):COMPARE_COMPUTE:-dx11 -compute -shaderobj 7//TEST(compute):COMPARE_COMPUTE:-vk -compute -shaderobj -emit-spirv-via-glsl 8//TEST(compute):COMPARE_COMPUTE:-vk -compute -shaderobj -emit-spirv-directly 9 10//TEST_INPUT:cbuffer(data=[4 0 0 0]):name=C 11cbuffer C 12{ 13 int y; 14} 15 16int test(int x) 17{ 18 return int(fmod(float(x), float(y))); 19} 20 21//TEST_INPUT:ubuffer(data=[-7 -2 2 7], stride=4):out,name outputBuffer 22RWStructuredBuffer<int> outputBuffer; 23 24[numthreads(4, 1, 1)] 25void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 26{ 27 uint tid = dispatchThreadID.x; 28 outputBuffer[tid] = test(outputBuffer[tid]); 29}