From: Chris Duncan Date: Tue, 4 Feb 2025 21:38:32 +0000 (-0800) Subject: Move temp variables to be near other declarations in main. X-Git-Tag: v3.0.0~30 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=92fe12e34e7870a707a74ce45a5f22cc1b85b596;p=nano-pow.git Move temp variables to be near other declarations in main. --- diff --git a/src/shaders/compute.wgsl b/src/shaders/compute.wgsl index c07ce35..f6a11e5 100644 --- a/src/shaders/compute.wgsl +++ b/src/shaders/compute.wgsl @@ -108,6 +108,14 @@ fn main(id: vec3) { var vCD: vec4 = vec4(0xADE682F9u, 0x510E527Fu, 0x2B3E6C1Fu, 0x9B05688Cu); var vEF: vec4 = vec4(0x04BE4294u, 0xE07C2654u, 0x137E2179u, 0x5BE0CD19u); + /** + * Temporary variables used for subprocesses i=4 through i=7 + */ + var v56: vec4; + var vFC: vec4; + var v74: vec4; + var vDE: vec4; + /** * Twelve rounds of G mixing as part of BLAKE2b compression step. Normally, * each round is divided into eight subprocesses; NanoPow compresses these @@ -144,10 +152,7 @@ fn main(id: vec3) { * Each sum step has an extra carry addition. Note that the m[sigma] sum is * skipped if m[sigma] is zero since it effectively does nothing. */ - var v56: vec4; - var vFC: vec4; - var v74: vec4; - var vDE: vec4; + /**************************************************************************** * ROUND(0) * ****************************************************************************/