summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.global-const-init.frag
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/3rdparty/glslang/Test/hlsl.global-const-init.frag')
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/hlsl.global-const-init.frag14
1 files changed, 14 insertions, 0 deletions
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.global-const-init.frag b/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.global-const-init.frag
new file mode 100644
index 00000000000..d8f36c9664f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.global-const-init.frag
@@ -0,0 +1,14 @@
+
+cbuffer CB {
+ float4 foo;
+};
+
+static const float4 bar = foo; // test const (in the immutable sense) initializer from non-const.
+
+static const float2 a1[2] = { { 1, 2 }, { foo.x, 4 } }; // not entirely constant
+static const float2 a2[2] = { { 5, 6 }, { 7, 8 } }; // entirely constant
+
+float4 main() : SV_Target0
+{
+ return bar;
+}