diff options
Diffstat (limited to 'tests/bugs/vec-init-list.hlsl')
| -rw-r--r-- | tests/bugs/vec-init-list.hlsl | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/bugs/vec-init-list.hlsl b/tests/bugs/vec-init-list.hlsl index 2f82a96b0..fe8cba09f 100644 --- a/tests/bugs/vec-init-list.hlsl +++ b/tests/bugs/vec-init-list.hlsl @@ -2,7 +2,14 @@ // Check handling of initializer list for vector -#ifndef __SLANG__ +#ifdef __SLANG__ +#define BEGIN_CBUFFER(NAME) cbuffer NAME +#define END_CBUFFER(NAME, REG) /**/ +#define CBUFFER_REF(NAME, FIELD) FIELD +#else +#define BEGIN_CBUFFER(NAME) struct SLANG_ParameterGroup_##NAME +#define END_CBUFFER(NAME, REG) ; cbuffer NAME : REG { SLANG_ParameterGroup_##NAME NAME; } +#define CBUFFER_REF(NAME, FIELD) NAME.FIELD #define C C_0 #define a a_0 @@ -10,10 +17,11 @@ #endif -cbuffer C : register(b0) +BEGIN_CBUFFER(C) { - float4 a; -}; + float4 a; +} +END_CBUFFER(C, register(b0)) float w0(float x) { return x; } float w1(float x) { return x; } @@ -22,6 +30,10 @@ float w3(float x) { return x; } float4 main() : SV_Position { - float4 wx = { w0(a.x), w1(a.x), w2(a.x), w3(a.x), }; + float4 wx = { + w0(CBUFFER_REF(C,a).x), + w1(CBUFFER_REF(C,a).x), + w2(CBUFFER_REF(C,a).x), + w3(CBUFFER_REF(C,a).x), }; return wx; } |
