fuckingtech/public/assets/glsl/lygia/math/sum.wgsl
Elias Rhouzlane bf76c6b086 fix: code
2025-04-06 17:23:52 +02:00

13 lines
496 B
WebGPU Shading Language

/*
contributors: Patricio Gonzalez Vivo
description: Sum elements of a vector
license:
- Copyright (c) 2021 Patricio Gonzalez Vivo under Prosperity License - https://prosperitylicense.com/versions/3.0.0
- Copyright (c) 2021 Patricio Gonzalez Vivo under Patron License - https://lygia.xyz/license
*/
fn sum(v: f32 ) -> f32 { return v; }
fn sum2(v: vec2f ) -> f32 { return v.x+v.y; }
fn sum3(v: vec3f ) -> f32 { return v.x+v.y+v.z; }
fn sum4(v: vec4f ) -> f32 { return v.x+v.y+v.z+v.w; }