summaryrefslogtreecommitdiff
path: root/tests/bindings/glsl-parameter-blocks.slang.glsl
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-04-11 16:18:29 -0700
committerGitHub <noreply@github.com>2018-04-11 16:18:29 -0700
commitbaf194e7456ba4568dcf11249896af35b3ce18cc (patch)
treef75e20db450100d41bfa9c384a8bab0fdc28a749 /tests/bindings/glsl-parameter-blocks.slang.glsl
parent6322983fa4dc84ef1e9dd8fad54d4c1580436e67 (diff)
Introduce an IR-level type system (#481)
* Introduce an IR-level type system Up to this point, the Slang IR has used the front-end type system to represent types in the IR. As a result (but ultimately more importantly) the IR representation of generics and specialization has used AST-level concepts embedded in the IR. For example, to express the specialization of `vector<T,N>` to a concrete type `float` for `T`, we needed an IR operation that could represent the specialization, with operands that somehow represented the type argument `float`. The whole thing was very complicated. The big idea of this change is to introduce a new representation in which types in the IR are just ordinary instructions, so that using them as operands makes sense. The hierarchy of IR types closely mirrors the AST-side hierarchy for now, and that will probably be something we should maintain going forward. In order to make these changes work, though, I also had to do major overhauls of things like the way substitutions are performed, how we check interface conformances, the way lookup through interface types is done, etc. etc. This is a big change, and unfortunately any attempt to summarize it in the commit message wouldn't do it justice. * Fix 64-bit build warning * Fix up some clang warnings/errors
Diffstat (limited to 'tests/bindings/glsl-parameter-blocks.slang.glsl')
-rw-r--r--tests/bindings/glsl-parameter-blocks.slang.glsl41
1 files changed, 29 insertions, 12 deletions
diff --git a/tests/bindings/glsl-parameter-blocks.slang.glsl b/tests/bindings/glsl-parameter-blocks.slang.glsl
index d05eea485..b65ee0e49 100644
--- a/tests/bindings/glsl-parameter-blocks.slang.glsl
+++ b/tests/bindings/glsl-parameter-blocks.slang.glsl
@@ -1,39 +1,56 @@
//TEST_IGNORE_FILE:
#version 450 core
-struct _ST04Test
+#define Test _ST04Test
+#define a _SV04Test1a
+
+#define gTest _SV05gTestL0
+#define gTest_t _SV05gTestL1
+#define gTest_s _SV05gTestL2
+
+#define ParameterBlock_gTest _S1
+
+#define main_result _S2
+#define uv _S3
+
+#define temp_uv _S4
+#define temp_a _S5
+#define temp_sample _S6
+#define temp_add _S7
+
+struct Test
{
vec4 a;
};
layout(binding = 0, set = 1)
-uniform _S1
+uniform ParameterBlock_gTest
{
- _ST04Test _SV05gTestL0;
+ Test gTest;
};
layout(binding = 1, set = 1)
-uniform texture2D _SV05gTestL1;
+uniform texture2D gTest_t;
layout(binding = 2, set = 1)
-uniform sampler _SV05gTestL2;
+uniform sampler gTest_s;
layout(location = 0)
-out vec4 _S2;
+out vec4 main_result;
layout(location = 0)
-in vec2 _S3;
+in vec2 uv;
void main()
{
- vec2 _S4 = _S3;
+ vec2 temp_uv = uv;
- vec4 _S5 = _SV05gTestL0.a;
+ vec4 temp_a = gTest.a;
- vec4 _S6 = texture(sampler2D(_SV05gTestL1, _SV05gTestL2), _S4);
+ vec4 temp_sample = texture(sampler2D(gTest_t, gTest_s), temp_uv);
- vec4 _S7 = _S5 + _S6;
- _S2 = _S7;
+ vec4 temp_add = temp_a + temp_sample;
+ main_result = temp_add;
return;
}