diff options
author | Brian <brian@yutani.localnet.net> | 2007-01-16 14:10:30 -0700 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-01-16 14:10:30 -0700 |
commit | 99e788fe561b1dd54ce083d3f05e6895fb91953a (patch) | |
tree | 94644accb603efad2e3537627b25d4aa41be5b5f /src/mesa/shader/slang/library/slang_core.gc | |
parent | 156e583a350670cb877879673b8d050b11f973dc (diff) |
some additional vector constructors
Diffstat (limited to 'src/mesa/shader/slang/library/slang_core.gc')
-rw-r--r-- | src/mesa/shader/slang/library/slang_core.gc | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc index d7f0976fde..78b983ce9a 100644 --- a/src/mesa/shader/slang/library/slang_core.gc +++ b/src/mesa/shader/slang/library/slang_core.gc @@ -155,11 +155,20 @@ float __constructor(const float f) __retVal = f.x; } + +//// vec2 constructors + vec2 __constructor(const float f) { __retVal.xy = f.xx; } +vec2 __constructor(const float x, const float y) +{ + __retVal.x = x; + __retVal.y = y; +} + vec2 __constructor (const int i) { float x; __asm int_to_float x, i; @@ -170,11 +179,26 @@ vec2 __constructor (const bool b) { return vec2 (b ? 1.0 : 0.0); } +vec2 __constructor(const vec3 v) +{ + __retVal.xy = v.xy; +} + + +//// vec3 constructors + vec3 __constructor(const float f) { __retVal.xyz = f.xxx; } +vec3 __constructor(const float x, const float y, const float z) +{ + __retVal.x = x; + __retVal.y = y; + __retVal.z = z; +} + vec3 __constructor (const int i) { float x; __asm int_to_float x, i; @@ -191,6 +215,8 @@ vec3 __constructor(const vec4 v) } +//// vec4 constructors + vec4 __constructor(const float f) { __retVal.xyzw = f.xxxx; @@ -484,7 +510,9 @@ float __operator * (const float a, const float b) float __operator / (const float a, const float b) { - __asm float_divide __retVal, a, b; + float bInv; + __asm float_rcp bInv.x, b.x; + __asm vec4_multiply __retVal.x, a, bInv; } |