summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics
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/diagnostics
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/diagnostics')
-rw-r--r--tests/diagnostics/global-uniform.slang.expected4
-rw-r--r--tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl21
-rw-r--r--tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl.expected11
-rw-r--r--tests/diagnostics/single-shader-record.slang.expected2
4 files changed, 35 insertions, 3 deletions
diff --git a/tests/diagnostics/global-uniform.slang.expected b/tests/diagnostics/global-uniform.slang.expected
index 44d3599bb..70877f4bd 100644
--- a/tests/diagnostics/global-uniform.slang.expected
+++ b/tests/diagnostics/global-uniform.slang.expected
@@ -1,9 +1,9 @@
result code = 0
standard error = {
-tests/diagnostics/global-uniform.slang(10): warning 39016: 'b' is implicitly a global shader parameter, not a global variable. If a global variable is intended, add the 'static' modifier. If a uniform shader parameter is intended, add the 'uniform' modifier to silence this warning.
+tests/diagnostics/global-uniform.slang(10): warning 39019: 'b' is implicitly a global shader parameter, not a global variable. If a global variable is intended, add the 'static' modifier. If a uniform shader parameter is intended, add the 'uniform' modifier to silence this warning.
const uint4 b = uint4(0,1,2,3);
^
-tests/diagnostics/global-uniform.slang(13): warning 39016: 'c' is implicitly a global shader parameter, not a global variable. If a global variable is intended, add the 'static' modifier. If a uniform shader parameter is intended, add the 'uniform' modifier to silence this warning.
+tests/diagnostics/global-uniform.slang(13): warning 39019: 'c' is implicitly a global shader parameter, not a global variable. If a global variable is intended, add the 'static' modifier. If a uniform shader parameter is intended, add the 'uniform' modifier to silence this warning.
C c;
^
}
diff --git a/tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl b/tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl
new file mode 100644
index 000000000..f69a0c3d5
--- /dev/null
+++ b/tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl
@@ -0,0 +1,21 @@
+//DIAGNOSTIC_TEST:SIMPLE:-target glsl -profile ps_4_0 -entry main -fvk-t-shift 5 all -fvk-t-shift 7 2 -fvk-s-shift -3 0 -fvk-b-shift 1 2 -no-codegen
+
+struct Data
+{
+ float a;
+ int b;
+};
+
+Texture2D t : register(t0);
+SamplerState s : register(s4);
+ConstantBuffer<Data> c : register(b2);
+
+Texture2D t2 : register(t0, space2);
+
+RWStructuredBuffer<Data> u : register(u11);
+RWStructuredBuffer<int> u2 : register(u3, space2);
+
+float4 main() : SV_TARGET
+{
+ return float4(1, 1, 1, 0);
+} \ No newline at end of file
diff --git a/tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl.expected b/tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl.expected
new file mode 100644
index 000000000..a7e4e27bb
--- /dev/null
+++ b/tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl.expected
@@ -0,0 +1,11 @@
+result code = 0
+standard error = {
+tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl(11): warning 39016: unable to infer Vulkan binding for 'c', automatic layout will be used
+ConstantBuffer<Data> c : register(b2);
+ ^
+tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl(15): warning 39016: unable to infer Vulkan binding for 'u', automatic layout will be used
+RWStructuredBuffer<Data> u : register(u11);
+ ^
+}
+standard output = {
+}
diff --git a/tests/diagnostics/single-shader-record.slang.expected b/tests/diagnostics/single-shader-record.slang.expected
index 5d843c2e6..ce92849fb 100644
--- a/tests/diagnostics/single-shader-record.slang.expected
+++ b/tests/diagnostics/single-shader-record.slang.expected
@@ -1,6 +1,6 @@
result code = -1
standard error = {
-(0): error 39017: can have at most one 'shader record' attributed constant buffer; found 2.
+(0): error 39020: can have at most one 'shader record' attributed constant buffer; found 2.
}
standard output = {
}