diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-06-28 07:39:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-28 07:39:31 -0400 |
| commit | 97963c5c119a3445fa6353809669d4553952e66c (patch) | |
| tree | 321161d206ccc5dfd7fc0fc3261c1ec3847f84a4 /tests/bindings | |
| parent | 9ddbea318d347f55c81c82e71ee09c45aeb89c59 (diff) | |
Add support for vk::image_format attribute (#2945)
Diffstat (limited to 'tests/bindings')
| -rw-r--r-- | tests/bindings/vk-image-format.slang | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/bindings/vk-image-format.slang b/tests/bindings/vk-image-format.slang new file mode 100644 index 000000000..2f7bb53b5 --- /dev/null +++ b/tests/bindings/vk-image-format.slang @@ -0,0 +1,35 @@ +// 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) + +// 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; + +cbuffer C +{ + uint2 index; +} + +float4 main(): SV_Target +{ + float4 result = 0; + + result += typicalTexture[index]; + result += snormTexture[index]; + result += specialTexture[index]; + + return result; +} |
