flare-slang/shader/_test-rng-xoroshiro128plus.slang

18 lines
589 B
Plaintext
Raw Normal View History

2025-01-04 16:51:07 -05:00
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -shaderobj -output-using-type
import rng;
//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<uint64_t> outputBuffer;
[numthreads(1, 1, 1)]
void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
{
Xoroshiro128Plus rng = {1, 2};
for (int i = 0; i < 5; i++)
{
outputBuffer[i] = rng.next();
}
}