diff options
author | Brian <brian@yutani.localnet.net> | 2006-12-20 18:04:59 -0700 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2006-12-20 18:04:59 -0700 |
commit | a33532f5f4b06aab49238aa193452f8efee7a291 (patch) | |
tree | ed714aaa165bc87868cb0eb9eab2625ebad8cff5 /src/mesa/shader/slang/library/slang_core.gc | |
parent | 1ff1e89ff4abf15be9442f06e5123547d1e64a5a (diff) |
checkpoint: re-org assignment operator functions
Diffstat (limited to 'src/mesa/shader/slang/library/slang_core.gc')
-rwxr-xr-x | src/mesa/shader/slang/library/slang_core.gc | 238 |
1 files changed, 167 insertions, 71 deletions
diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc index d99eb10a8b..decf615c0d 100755 --- a/src/mesa/shader/slang/library/slang_core.gc +++ b/src/mesa/shader/slang/library/slang_core.gc @@ -848,6 +848,173 @@ void __operator /= (inout vec4 v, const vec4 u) +//// ivec2/int assignment operators + +void __operator += (inout ivec2 v, const int a) +{ + v.x += a; + v.y += a; +} + +void __operator -= (inout ivec2 v, const int a) +{ + v.x -= a; + v.y -= a; +} + +void __operator *= (inout ivec2 v, const int a) +{ + v.x *= a; + v.y *= a; +} + +void __operator /= (inout ivec2 v, const int a) +{ +// XXX rcp + v.x /= a; + v.y /= a; +} + + +//// ivec3/int assignment operators + +void __operator += (inout ivec3 v, const int a) +{ + v.x += a; + v.y += a; + v.z += a; +} + +void __operator -= (inout ivec3 v, const int a) +{ + v.x -= a; + v.y -= a; + v.z -= a; +} + +void __operator *= (inout ivec3 v, const int a) +{ + v.x *= a; + v.y *= a; + v.z *= a; +} + +void __operator /= (inout ivec3 v, const int a) +{ + v.x /= a; + v.y /= a; + v.z /= a; +} + + +//// ivec4/int assignment operators + +void __operator += (inout ivec4 v, const int a) +{ + __asm vec4_add v, v, a.xxxx; +} + +void __operator -= (inout ivec4 v, const int a) +{ + __asm vec4_subtract v, v, a.xxxx; +} + +void __operator *= (inout ivec4 v, const int a) +{ + __asm vec4_multiply v, v, a.xxxx; +} + +void __operator /= (inout ivec4 v, const int a) +{ + v.x /= a; + v.y /= a; + v.z /= a; + v.w /= a; +} + + + +//// vec2/float assignment operators + +void __operator += (inout vec2 v, const float a) +{ + __asm vec4_add v.xy, v, a.xx; +} + +void __operator -= (inout vec2 v, const float a) +{ + __asm vec4_subtract v.xy, v, a.xx; +} + +void __operator *= (inout vec2 v, const float a) +{ + __asm vec4_multiply v.xy, v, a.xx; +} + +void __operator /= (inout vec2 v, const float a) +{ +// XXX rcp + v.x /= a; + v.y /= a; +} + + +//// vec3/float assignment operators + +void __operator += (inout vec3 v, const float a) +{ + __asm vec4_add v.xyz, v, a.xxx; +} + +void __operator -= (inout vec3 v, const float a) +{ + __asm vec4_subtract v.xyz, v, a.xxx; +} + +void __operator *= (inout vec3 v, const float a) +{ + __asm vec4_multiply v.xyz, v, a.xxx; +} + +void __operator /= (inout vec3 v, const float a) +{ + v.x /= a; + v.y /= a; + v.z /= a; +} + + +//// vec4/float assignment operators + +void __operator += (inout vec4 v, const float a) +{ + __asm vec4_add v, v, a.xxxx; +} + +void __operator -= (inout vec4 v, const float a) +{ + __asm vec4_subtract v, v, a.xxxx; +} + +void __operator *= (inout vec4 v, const float a) +{ + __asm vec4_multiply v, v, a.xxxx; +} + +void __operator /= (inout vec4 v, const float a) +{ + v.x /= a; + v.y /= a; + v.z /= a; + v.w /= a; +} + + + + + + + void __operator += (inout mat2 m, const mat2 n) { m[0] += n[0]; m[1] += n[1]; @@ -962,77 +1129,6 @@ void __operator /= (inout mat4 m, const mat4 n) { m[3] /= n[3]; } -void __operator += (inout vec2 v, const float a) { - v.x += a; - v.y += a; -} - -void __operator -= (inout vec2 v, const float a) { - v.x -= a; - v.y -= a; -} - -void __operator *= (inout vec2 v, const float a) { - v.x *= a; - v.y *= a; -} - -void __operator /= (inout vec2 v, const float a) { - v.x /= a; - v.y /= a; -} - -void __operator += (inout vec3 v, const float a) { - v.x += a; - v.y += a; - v.z += a; -} - -void __operator -= (inout vec3 v, const float a) { - v.x -= a; - v.y -= a; - v.z -= a; -} - -void __operator *= (inout vec3 v, const float a) { - v.x *= a; - v.y *= a; - v.z *= a; -} - -void __operator /= (inout vec3 v, const float a) { - v.x /= a; - v.y /= a; - v.z /= a; -} - -void __operator += (inout vec4 v, const float a) { - v.x += a; - v.y += a; - v.z += a; - v.w += a; -} - -void __operator -= (inout vec4 v, const float a) { - v.x -= a; - v.y -= a; - v.z -= a; - v.w -= a; -} - -void __operator *= (inout vec4 v, const float a) { - v.x *= a; - v.y *= a; - v.z *= a; - v.w *= a; -} - -void __operator /= (inout vec4 v, const float a) { - v.x /= a; - v.y /= a; - v.z /= a; - v.w /= a; -} void __operator += (inout mat2 m, const float a) { m[0] += a; |