diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-07-18 12:52:24 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-07-18 14:46:41 -0600 |
commit | 2b3515c5b21a417cf32c5259b93da4deb2a951c6 (patch) | |
tree | 82df5f410c2773ff47b5c5f8aa554d06d5562cd9 /src/mesa/shader/slang | |
parent | b64882d0f8674df3e4e60f5786eb48027518c279 (diff) | |
download | external_mesa3d-2b3515c5b21a417cf32c5259b93da4deb2a951c6.zip external_mesa3d-2b3515c5b21a417cf32c5259b93da4deb2a951c6.tar.gz external_mesa3d-2b3515c5b21a417cf32c5259b93da4deb2a951c6.tar.bz2 |
mesa: fix some GLSL /= int operators
plus add a few more special constructors to improve code quality.
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r-- | src/mesa/shader/slang/library/slang_core.gc | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc index 0fd2b7e..2c3a5a6 100644 --- a/src/mesa/shader/slang/library/slang_core.gc +++ b/src/mesa/shader/slang/library/slang_core.gc @@ -176,6 +176,11 @@ vec2 __constructor(const bool b) __retVal.xy = b.xx; } +vec2 __constructor(const bvec2 b) +{ + __retVal = b; +} + vec2 __constructor(const vec3 v) { __retVal.xy = v.xy; @@ -211,6 +216,11 @@ vec3 __constructor(const bool b) __retVal.xyz = b.xxx; } +vec3 __constructor(const bvec3 b) +{ + __retVal = b; +} + vec3 __constructor(const vec4 v) { __retVal.xyz = v.xyz; @@ -242,6 +252,11 @@ vec4 __constructor(const bool b) __retVal = b.xxxx; } +vec4 __constructor(const bvec4 b) +{ + __retVal = b; +} + vec4 __constructor(const vec3 v3, const float f) { // XXX this constructor shouldn't be needed anymore @@ -360,8 +375,7 @@ bvec2 __constructor(const int i) bvec2 __constructor(const vec2 v) { - const vec2 zero = vec2(0.0, 0.0); - __asm vec4_sne __retVal.xy, v, zero; + __asm vec4_sne __retVal.xy, v, 0.0; } bvec2 __constructor(const ivec2 v) @@ -1226,7 +1240,7 @@ void __operator /= (inout int a, const int b) float invB; __asm float_rcp invB, b; __asm vec4_multiply a, a, invB; - __asm float_to_int __retVal, a; + __asm float_to_int a, a; } @@ -1253,7 +1267,7 @@ void __operator /= (inout ivec2 v, const ivec2 u) __asm float_rcp inv.x, u.x; __asm float_rcp inv.y, u.y; __asm vec4_multiply z, v, inv; - __asm float_to_int __retVal, z; + __asm float_to_int v, z; } @@ -1280,7 +1294,7 @@ void __operator /= (inout ivec3 v, const ivec3 u) __asm float_rcp inv.x, u.x; __asm float_rcp inv.y, u.y; __asm vec4_multiply z, v, inv; - __asm float_to_int __retVal, z; + __asm float_to_int v, z; } @@ -1307,7 +1321,7 @@ void __operator /= (inout ivec4 v, const ivec4 u) __asm float_rcp inv.x, u.x; __asm float_rcp inv.y, u.y; __asm vec4_multiply z, v, inv; - __asm float_to_int __retVal, z; + __asm float_to_int v, z; } @@ -1315,7 +1329,7 @@ void __operator /= (inout ivec4 v, const ivec4 u) void __operator += (inout float a, const float b) { - __asm vec4_add a.x, a.x, b; + __asm vec4_add a.x, a.x, b.x; } void __operator -= (inout float a, const float b) |