diff options
| author | Yong He <yonghe@outlook.com> | 2019-01-23 19:54:21 -0800 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2019-01-23 19:54:21 -0800 |
| commit | a4261598be7e3229a6280002eaced96d8cb3ced6 (patch) | |
| tree | 855214769ce6a79ddca31853f06bc82fc82c060e /tests | |
| parent | 935b629448fedc187243bfe88d4149bf30d89c05 (diff) | |
Fixing GLSL sign function.
fixes #602
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cross-compile/sign.slang | 13 | ||||
| -rw-r--r-- | tests/cross-compile/sign.slang.glsl | 17 | ||||
| -rw-r--r-- | tests/cross-compile/sign.slang.hlsl | 6 |
3 files changed, 36 insertions, 0 deletions
diff --git a/tests/cross-compile/sign.slang b/tests/cross-compile/sign.slang new file mode 100644 index 000000000..17a51d93d --- /dev/null +++ b/tests/cross-compile/sign.slang @@ -0,0 +1,13 @@ +// sign.slang + +//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage fragment +//TEST:CROSS_COMPILE:-target dxil-assembly -entry main -stage fragment -profile sm_6_0 + +// Test cross compilation of the sign function + +float4 main() : SV_Target +{ + float4 s = sign(float4(1.5, 1.0, -1.5, -1.0)); + return s; +} + diff --git a/tests/cross-compile/sign.slang.glsl b/tests/cross-compile/sign.slang.glsl new file mode 100644 index 000000000..7a3a37c51 --- /dev/null +++ b/tests/cross-compile/sign.slang.glsl @@ -0,0 +1,17 @@ +//TEST_IGNORE_FILE: +#version 450 +layout(row_major) uniform; +layout(row_major) buffer; + +#line 8 0 +layout(location = 0) +out vec4 _S1; + + +#line 8 +void main() +{ + ivec4 _S2 = ivec4(sign(vec4(1.50000000000000000000, 1.00000000000000000000, -1.50000000000000000000, -1.00000000000000000000))); + _S1 = vec4(_S2); + return; +}
\ No newline at end of file diff --git a/tests/cross-compile/sign.slang.hlsl b/tests/cross-compile/sign.slang.hlsl new file mode 100644 index 000000000..d7016dde7 --- /dev/null +++ b/tests/cross-compile/sign.slang.hlsl @@ -0,0 +1,6 @@ +//TEST_IGNORE_FILE: +float4 main() : SV_Target +{ + float4 s = sign(float4(1.5, 1.0, -1.5, -1.0)); + return s; +}
\ No newline at end of file |
