diff options
| author | Yong He <yonghe@google.com> | 2019-01-25 17:45:42 -0800 |
|---|---|---|
| committer | Yong He <yonghe@google.com> | 2019-01-25 18:10:57 -0800 |
| commit | 864c38ee72991f414f2478ccacb462bfb11b4bca (patch) | |
| tree | 6cf97e1d3ad5546c8ee139cdc2acffc790804031 /tests | |
| parent | a38490d7716ef6cbf9cbb992b880b9bbc9c1ac93 (diff) | |
fix up empty-struct-parameters
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cross-compile/glsl-generic-in.slang | 11 | ||||
| -rw-r--r-- | tests/cross-compile/glsl-generic-in.slang.glsl | 26 |
2 files changed, 25 insertions, 12 deletions
diff --git a/tests/cross-compile/glsl-generic-in.slang b/tests/cross-compile/glsl-generic-in.slang index e9b9a5a91..90fe387ba 100644 --- a/tests/cross-compile/glsl-generic-in.slang +++ b/tests/cross-compile/glsl-generic-in.slang @@ -3,10 +3,11 @@ interface IField { float get(); }; -struct GIn<TField> +struct GIn<TField : IField, TEmptyField> { float3 p0; TField field; + TEmptyField e; }; struct F : IField { @@ -14,15 +15,19 @@ struct F : IField float2 v1; float get() { return v0.x + v1.x; } }; +struct E +{ + float get() {return 1.0;} +}; struct VOut { float4 projPos : SV_POSITION; }; -VOut main(GIn<F> vIn) +VOut main(GIn<F, E> vIn) { VOut vout; - vout.projPos = float4(vIn.p0, vIn.field.get()); + vout.projPos = float4(vIn.p0, vIn.field.get() + vIn.e.get()); return vout; }
\ No newline at end of file diff --git a/tests/cross-compile/glsl-generic-in.slang.glsl b/tests/cross-compile/glsl-generic-in.slang.glsl index 66d7546ff..7dbe7feca 100644 --- a/tests/cross-compile/glsl-generic-in.slang.glsl +++ b/tests/cross-compile/glsl-generic-in.slang.glsl @@ -1,9 +1,8 @@ -//TEST_IGNORE_FILE #version 450 layout(row_major) uniform; layout(row_major) buffer; -#line 11 0 +#line 12 0 struct F_0 { vec4 v0_0; @@ -11,15 +10,23 @@ struct F_0 }; -#line 15 +#line 16 float F_get_0(F_0 this_0) { -#line 15 +#line 16 return this_0.v0_0.x + this_0.v1_0.x; } +float E_get_0() +{ + +#line 20 + return 1.00000000000000000000; +} + + #line 6 layout(location = 0) in vec3 _S1; @@ -42,20 +49,21 @@ struct VOut_0 }; -#line 23 + void main() { GIn_0 _S4 = GIn_0(_S1, F_0(_S2, _S3)); -#line 25 +#line 30 VOut_0 vout_0; vec3 _S5 = _S4.p0_0; -#line 26 +#line 31 float _S6 = F_get_0(_S4.field_0); + float _S7 = E_get_0(); -#line 26 - vout_0.projPos_0 = vec4(_S5, _S6); +#line 31 + vout_0.projPos_0 = vec4(_S5, _S6 + _S7); gl_Position = vout_0.projPos_0; return; }
\ No newline at end of file |
