diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-04-11 16:18:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-11 16:18:29 -0700 |
| commit | baf194e7456ba4568dcf11249896af35b3ce18cc (patch) | |
| tree | f75e20db450100d41bfa9c384a8bab0fdc28a749 /tests/bindings/binding1.hlsl | |
| parent | 6322983fa4dc84ef1e9dd8fad54d4c1580436e67 (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/binding1.hlsl')
| -rw-r--r-- | tests/bindings/binding1.hlsl | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/bindings/binding1.hlsl b/tests/bindings/binding1.hlsl index 879a19816..adc06edaa 100644 --- a/tests/bindings/binding1.hlsl +++ b/tests/bindings/binding1.hlsl @@ -15,15 +15,22 @@ #define R(X) /**/ #else #define R(X) X + +#define tB _SV02tB +#define sB _SV02sB + +#define C1 _SV023SLANG_parameterGroup_C1 +#define c1 _SV023SLANG_ParameterGroup_C12c1 + #endif float4 use(float4 val) { return val; }; float4 use(Texture2D t, SamplerState s) { return t.Sample(s, 0.0); } -Texture2D t0 R(: register(t0)); -Texture2D t1 R(: register(t1)); -SamplerState s0 R(: register(s0)); -SamplerState s1 R(: register(s1)); +Texture2D tA R(: register(t0)); +Texture2D tB R(: register(t1)); +SamplerState sA R(: register(s0)); +SamplerState sB R(: register(s1)); cbuffer C0 R(: register(b0)) { @@ -35,7 +42,7 @@ cbuffer C1 R(: register(b1)) float c1; } -float4 main() : SV_Target +float4 main() : SV_TARGET { - return use(t1,s1) + use(c1); + return use(tB,sB) + use(c1); }
\ No newline at end of file |
