summaryrefslogtreecommitdiffstats
path: root/tests/bindings/vk-image-format.slang
blob: ff0422d28d3e156ae31cb7feb9eba583e775525c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// vk-image-format.slang

//TEST:SIMPLE(filecheck=CHECK):-target glsl -profile ps_4_0 -entry main -line-directive-mode none

//CHECK: layout(r32f)
//CHECK: layout(r16_snorm)
//CHECK: layout(r11f_g11f_b10f)
//CHECK: layout(rgba16_snorm)

// Something typical
[vk::image_format("r32f")]
RWTexture2D<float> typicalTexture;

// snorm
[vk::image_format("r16snorm")]
RWTexture2D<float> snormTexture;

// Special case
[vk::image_format("r11g11b10f")]
RWTexture2D<float4> specialTexture;

// snorm with underscore in format name
[vk::image_format("rgba16_snorm")]
RWTexture2D<float4> snormTextureWithUnderscore;

cbuffer C
{
	uint2 index;
}

float4 main(): SV_Target
{
    float4 result = 0;

    result += typicalTexture[index];
    result += snormTexture[index];
    result += specialTexture[index];
    result += snormTextureWithUnderscore[index];
    
    return result;
}