Hasan Mohsin
Hasan Mohsin
WGSL: ``` @group(0) @binding(0) var u: i32; @compute @workgroup_size(1) fn main() { switch (u) { case 0: { switch (u) { case 0: {} default: {} } } default: {}...
WGSL: ``` fn main() { var x = 0; switch (x) { case -1: { fallthrough; } default: { let var_2 = i32(11632); } } } ``` HLSL: ```hlsl void...
This program incorrectly outputs `-1` with DirectX. I think this is because of the use of `firstbitlow`, since it works correctly with tint which uses its own polyfill for `firstbitlow`...
The spec says that aliasing is invalid if the aliases access the same memory location and at least one of the accesses is a write. ``` @group(0) @binding(1) var s_out:...
WGSL: ```wgsl var c: array; fn f(e: ptr) { (*e)[0] = 1; } @compute @workgroup_size(1) fn main() { f(&c); } ``` HLSL: ```hlsl static int c[1] = {(int)0}; void f(inout...
This function is accepted, even though it doesn't return anything. Seems like it should be an error. ``` fn f() -> i32 { let x = 1 + 1; }...
WGSL: ``` fn f() -> array { return array(); } ``` HLSL: ```hlsl typedef int ret_Constructarray1_int_[1]; ret_Constructarray1_int_ Constructarray1_int_(int arg0) { int ret[1] = { arg0 }; return ret; } int...
Seems they were implemented for other backends in #1449 but not for HLSL.
The spec defines the semantics of `clamp(x, low, high)` to be `min(max(x, low), high)`. Naga directly translates `clamp` to the equivalent functions in metal and hlsl. However, the metal spec...
I've found what seems to be another hlsl compilation failure caused by FXC. This one incorrectly reports a divide by zero error. Interestingly it's only rejected when the `divide` call...