diff options
| author | Copilot <198982749+Copilot@users.noreply.github.com> | 2025-07-16 00:43:00 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-16 00:43:00 +0000 |
| commit | a8519e68b6df636932ca5d89a332b2a689259b0f (patch) | |
| tree | 69bb738a2b85cc3fdfba1e47994fc5362ee67859 /source | |
| parent | 652a8ee6883f08ce7cb55ef372277a535ce4d88f (diff) | |
Fix WGSL sign function to return correct int type instead of float (#7739)
* Initial plan
* Fix WGSL sign function to return int type properly
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Add vector version check for WGSL sign function test
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix FileCheck order in WGSL sign test - use DAG for order-independent checking
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/hlsl.meta.slang | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index 1dcb0b7d4..1443843a9 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -13107,7 +13107,7 @@ int sign(T x) }; else return __int_cast<int>(spirv_asm {OpExtInst $$T result glsl450 SSign $x}); - case wgsl: __intrinsic_asm "sign"; + case wgsl: __intrinsic_asm "i32(sign($0))"; } } @@ -13131,7 +13131,7 @@ vector<int, N> sign(vector<T, N> x) }; else return __int_cast<int>(spirv_asm {OpExtInst $$vector<T,N> result glsl450 SSign $x}); - case wgsl: __intrinsic_asm "sign"; + case wgsl: __intrinsic_asm "vec$N0<i32>(sign($0))"; default: VECTOR_MAP_UNARY(int, N, sign, x); } |
