From: Chris Duncan Date: Tue, 14 Jan 2025 21:17:09 +0000 (-0800) Subject: Replace more m scalar operations. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=d1ce5c752b2d92642d8c2da192d40e37743891ad;p=nano-pow.git Replace more m scalar operations. --- diff --git a/src/shaders/compute.wgsl b/src/shaders/compute.wgsl index 2a9eae9..a81c023 100644 --- a/src/shaders/compute.wgsl +++ b/src/shaders/compute.wgsl @@ -124,11 +124,7 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v_01.x + m0; - o1 = v_01.y + m1; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_01.x + m0 < v_01.x); @@ -3319,11 +3315,8 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v_01.x + m0; - o1 = v_01.y + m1; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_01.x + m0 < v_01.x); + @@ -4461,11 +4454,8 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v_01.x + m8; - o1 = v_01.y + m9; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m8, m9) + select(vec2(0u), vec2(0u, 1u), v_01.x + m8 < v_01.x); + @@ -4756,11 +4746,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v6 + m2; - o1 = v7 + m3; - o1 = o1 + select(0u, 1u, o0 < v6); - v6 = o0; - v7 = o1; + v_67.x = v6; + v_67.y = v7; + v_67 = v_67 + vec2(m2, m3) + select(vec2(0u), vec2(0u, 1u), v_67.x + m2 < v_67.x); + v6 = v_67.x; + v7 = v_67.y; // d = rotr64(d ^ a, 32) v_67.x = v6; @@ -5249,11 +5239,7 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v_01.x + m0; - o1 = v_01.y + m1; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_01.x + m0 < v_01.x); @@ -6083,11 +6069,7 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v_01.x + m0; - o1 = v_01.y + m1; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_01.x + m0 < v_01.x); @@ -7531,11 +7513,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v6 + m2; - o1 = v7 + m3; - o1 = o1 + select(0u, 1u, o0 < v6); - v6 = o0; - v7 = o1; + v_67.x = v6; + v_67.y = v7; + v_67 = v_67 + vec2(m2, m3) + select(vec2(0u), vec2(0u, 1u), v_67.x + m2 < v_67.x); + v6 = v_67.x; + v7 = v_67.y; // d = rotr64(d ^ a, 32) v_67.x = v6; @@ -8026,11 +8008,7 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v_01.x + m0; - o1 = v_01.y + m1; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_01.x + m0 < v_01.x);