summaryrefslogtreecommitdiffstats
path: root/tests/bindings
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-05-04 15:44:09 -0400
committerGitHub <noreply@github.com>2023-05-04 12:44:09 -0700
commitc0b6f59a6920a9efbb4ecc3b622529db484c64ef (patch)
treef1ee51fb9244da22c4157dfff40cda964ac7b28f /tests/bindings
parentee62b062e6b606c480c5f7358710b06c933b0efb (diff)
Improvements around HLSLToVulkanLayout (#2867)
* #include an absolute path didn't work - because paths were taken to always be relative. * Improve the HLSLToVulkanLayoutOptions interface. Add more diagnostics. Add diagnostics test. * Add check for global binding using file check. * Fix issues with some tests around making some diagnostics ids unique. * Small improvements with doc/handling of vk-<>-shift option setup. --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/bindings')
-rw-r--r--tests/bindings/hlsl-to-vulkan-global-binding.hlsl19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/bindings/hlsl-to-vulkan-global-binding.hlsl b/tests/bindings/hlsl-to-vulkan-global-binding.hlsl
new file mode 100644
index 000000000..ebccaab18
--- /dev/null
+++ b/tests/bindings/hlsl-to-vulkan-global-binding.hlsl
@@ -0,0 +1,19 @@
+//TEST:SIMPLE(filecheck=CHECK):-target glsl -profile ps_4_0 -entry main -fvk-bind-globals 5 9 -line-directive-mode none
+
+// CHECK: layout(binding = 0)
+// CHECK: uniform texture2D t_0;
+// CHECK: layout(binding = 1)
+// CHECK: uniform sampler sampler_0;
+// CHECK: layout(binding = 5, set = 9)
+// CHECK: layout(std140) uniform _S1
+
+uniform int a;
+uniform float b;
+
+Texture2D t;
+SamplerState sampler;
+
+float4 main() : SV_TARGET
+{
+ return t.SampleLevel(sampler, float2(a,b), 0) + float4(a, b, 1, 0);
+} \ No newline at end of file