yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
a7cb36901
master
1// vk-image-format.slang 2 3//TEST:SIMPLE(filecheck=CHECK):-target glsl -profile ps_4_0 -entry main -line-directive-mode none 4 5//CHECK: layout(r32f) 6//CHECK: layout(r16_snorm) 7//CHECK: layout(r11f_g11f_b10f) 8//CHECK: layout(rgba16_snorm) 9 10// Something typical 11[vk::image_format("r32f")] 12RWTexture2D<float> typicalTexture; 13 14// snorm 15[vk::image_format("r16snorm")] 16RWTexture2D<float> snormTexture; 17 18// Special case 19[vk::image_format("r11g11b10f")] 20RWTexture2D<float4> specialTexture; 21 22// snorm with underscore in format name 23[vk::image_format("rgba16_snorm")] 24RWTexture2D<float4> snormTextureWithUnderscore; 25 26cbuffer C 27{ 28 uint2 index; 29} 30 31float4 main(): SV_Target 32{ 33 float4 result = 0; 34 35 result += typicalTexture[index]; 36 result += snormTexture[index]; 37 result += specialTexture[index]; 38 result += snormTextureWithUnderscore[index]; 39 40 return result; 41}