yum-mirror/slang

Making it easier to work with shaders

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

Darren WihandiEmit errors for missing returns on unsupported targets (#6633)844d8d221

master
1.1 KiB40 linesraw
1//TEST:SIMPLE(filecheck=HLSL): -target hlsl -stage compute -entry computeMain
2//TEST:SIMPLE(filecheck=GLSL): -target glsl -stage compute -entry computeMain
3
4// Metal backend requires a new legalization pass to support emitting `TextureBufferType`
5//DISABLE_TEST:SIMPLE(filecheck=METAL): -target metal -stage compute -entry computeMain
6//DISABLE_TEST:SIMPLE(filecheck=METALLIB): -target metallib -stage compute -entry computeMain
7
8// SPIRV backend has no support for emitting `TextureBufferType`
9//DISABLE_TEST:SIMPLE(filecheck=SPIRV): -target spirv -stage compute -entry computeMain
10
11tbuffer tbuf : register(t0)
12{
13    float4 tb_val1;
14}
15
16tbuffer tbuf2 : register(t1)
17{
18    Texture2D<float4> texture2D;
19    float4 tb_val2;
20}
21
22
23// HLSL-DAG: t0
24// HLSL-DAG: t1
25// HLSL-DAG: t2
26
27// GLSL-DAG: binding = 0
28// GLSL-DAG: binding = 1
29// GLSL-DAG: binding = 2
30
31// METAL-DAG: [texture(0)]
32// METAL-DAG: [texture(1)]
33// METAL-DAG: [texture(2)]
34// METALLIB: @computeMain
35
36RWStructuredBuffer<float4> outputBuffer;
37[numthreads(1,1,1)]
38void computeMain() {
39    outputBuffer[0] = tb_val1 + texture2D[0] + tb_val2;
40}