summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cross-compile/half-conversion.slang13
-rw-r--r--tests/cross-compile/half-conversion.slang.glsl42
2 files changed, 55 insertions, 0 deletions
diff --git a/tests/cross-compile/half-conversion.slang b/tests/cross-compile/half-conversion.slang
new file mode 100644
index 000000000..316629f81
--- /dev/null
+++ b/tests/cross-compile/half-conversion.slang
@@ -0,0 +1,13 @@
+// half-conversion.slang
+
+//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage fragment
+
+cbuffer C
+{
+ uint4 u;
+}
+
+float4 main() : SV_Target
+{
+ return f16tof32(u);
+}
diff --git a/tests/cross-compile/half-conversion.slang.glsl b/tests/cross-compile/half-conversion.slang.glsl
new file mode 100644
index 000000000..3b7b740e4
--- /dev/null
+++ b/tests/cross-compile/half-conversion.slang.glsl
@@ -0,0 +1,42 @@
+//half-conversion.slang.glsl
+//TEST_IGNORE_FILE:
+
+#version 450
+
+struct SLANG_ParameterGroup_C_0
+{
+ uvec4 u_0;
+};
+
+layout(binding = 0)
+layout(std140) uniform _S1
+{
+ SLANG_ParameterGroup_C_0 _data;
+} C_0;
+
+vec4 f16tof32_0(uvec4 value_0)
+{
+ int i_0;
+ vec4 result_0;
+ i_0 = 0;
+ for(;;)
+ {
+ if(i_0 < 4) {} else break;
+
+ float _S2 = (unpackHalf2x16((value_0[i_0])).x);
+ result_0[i_0] = _S2;
+ int _S3 = i_0 + int(1);
+ i_0 = _S3;
+ }
+ return result_0;
+}
+
+layout(location = 0)
+out vec4 _S4;
+
+void main()
+{
+ vec4 _S5 = f16tof32_0(C_0._data.u_0);
+ _S4 = _S5;
+ return;
+}