yum-mirror/slang

Making it easier to work with shaders

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

ArielG-NVImplement 8.14-8.19 of OpenGL-GLSL specificationa697b2c67

master
1.1 KiB40 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#version 460
7
8groupshared uint raceConditionShared;
9
10//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer
11buffer MyBlockName2
12{
13    uint data[];
14} outputBuffer;
15
16layout(local_size_x = 4) in;
17bool testBarrier()
18{
19    for (int i = 0; i < 4; i++)
20    {
21        raceConditionShared = 3;
22        barrier();
23        raceConditionShared = 1;
24        if (raceConditionShared != 1)
25            return false;
26    }
27    return true
28        && raceConditionShared == 1
29        ;
30}
31
32void computeMain()
33{
34    outputBuffer.data[0] = true
35        && testBarrier()
36        ;
37    // CHECK_GLSL: void main(
38    // CHECK_SPV: OpEntryPoint
39    // BUF: 1
40}