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
803 B28 linesraw
1//TEST:SIMPLE(filecheck=CHECK_GLSL): -target glsl -stage fragment -entry main -allow-glsl
2//TEST:SIMPLE(filecheck=CHECK_SPV): -target spirv -emit-spirv-directly -stage fragment -entry main -allow-glsl
3#version 450
4// CHECK_SPV-DAG: OpEntryPoint
5// CHECK_GLSL-DAG: void main(
6
7layout(location = 0) out ivec4 outColorActual;
8
9layout (location = 0) in float inDataV1;
10
11bool isOk(float a, float b)   { return (a == b); }
12
13bool testFragmentProcessingInterpolateFunctions()
14{
15    float tmpStore = inDataV1;
16    return true
17        && interpolateAtCentroid(inDataV1) != -1.0f
18        && (tmpStore + inDataV1) != -0.1f
19        && isOk(inDataV1, tmpStore)
20        && inDataV1 != -1.0f
21        ;
22}
23
24void main() {
25    outColorActual = ivec4(true
26        && testFragmentProcessingInterpolateFunctions()
27        );
28}