yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Simon Kallweitupdate slang-rhi (#6587)ae1a5e408

master
1.1 KiB34 linesraw
1//TEST:SIMPLE(filecheck=CHECK_GLSL):  -allow-glsl -stage compute -entry computeMain -target glsl
2//TEST:SIMPLE(filecheck=CHECK_SPV):  -allow-glsl -stage compute -entry computeMain -target spirv -emit-spirv-directly
3//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl
4//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl -emit-spirv-directly
5
6//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer
7buffer MyBlockName2
8{
9    uint data[1];
10} outputBuffer;
11
12layout(local_size_x = 1) in;
13
14//TEST_INPUT: set image_1d = RWTexture1D(format=R32Sint, size=4, content=one, mipMaps = 1)
15uniform layout(binding=0,r32i) iimage1D image_1d;
16
17bool checkAllImageAtomicAdd()
18{
19    imageStore(image_1d, 0, ivec4(1));
20    return true
21        && imageAtomicAdd(image_1d, 0, 0) == 1
22        && imageLoad(image_1d, 0).x == 1
23        ;
24}
25
26// CHECK_GLSL: void main(
27// CHECK_SPV: OpEntryPoint
28void computeMain()
29{
30    outputBuffer.data[0] = true
31        && checkAllImageAtomicAdd()
32        ;
33    // BUF: 1
34}