summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-07-02 12:45:55 -0600
committerBrian Paul <[email protected]>2008-07-02 12:45:55 -0600
commit789fae163dbdbd7669b0442bd1a3ca4fea4ec259 (patch)
tree9426afdccf92688f0b5f7573228fd4b3c84ffcec /src/mesa
parent019ad5e284db08b46b484b409c1a54c302afd50b (diff)
mesa: fix all(bvec2) function typo, add missing bvec2/3/4() constuctors
cherry-picked from master
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/slang/library/slang_common_builtin.gc2
-rw-r--r--src/mesa/shader/slang/library/slang_core.gc38
2 files changed, 39 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc
index 26080cf26ca..356f5f9d8e9 100644
--- a/src/mesa/shader/slang/library/slang_common_builtin.gc
+++ b/src/mesa/shader/slang/library/slang_common_builtin.gc
@@ -1559,7 +1559,7 @@ bool any(const bvec4 v)
//// all
-bool all (const vec2 v)
+bool all (const bvec2 v)
{
float prod;
__asm vec4_multiply prod.x, v.x, v.y;
diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc
index ffa57f74c27..78e3ea9fdac 100644
--- a/src/mesa/shader/slang/library/slang_core.gc
+++ b/src/mesa/shader/slang/library/slang_core.gc
@@ -350,6 +350,19 @@ bvec2 __constructor(const int i)
__asm vec4_seq __retVal.xy, i.xx, zero;
}
+bvec2 __constructor(const vec2 v)
+{
+ const vec2 zero = vec2(0.0, 0.0);
+ __asm vec4_seq __retVal.xy, v, zero;
+}
+
+bvec2 __constructor(const ivec2 v)
+{
+ const ivec2 zero = ivec2(0, 0);
+ __asm vec4_seq __retVal.xy, v, zero;
+}
+
+
//// bvec3 constructors
@@ -377,6 +390,19 @@ bvec3 __constructor(const int i)
__asm vec4_seq __retVal.xyz, i.xxx, zero;
}
+bvec3 __constructor(const vec3 v)
+{
+ const vec3 zero = vec3(0.0, 0.0, 0.0);
+ __asm vec4_seq __retVal.xyz, v, zero;
+}
+
+bvec3 __constructor(const ivec3 v)
+{
+ const ivec3 zero = ivec3(0, 0, 0);
+ __asm vec4_seq __retVal.xyz, v, zero;
+}
+
+
//// bvec4 constructors
@@ -405,6 +431,18 @@ bvec4 __constructor(const int i)
__asm vec4_seq __retVal, i.xxxx, zero;
}
+bvec4 __constructor(const vec4 v)
+{
+ const vec4 zero = vec4(0.0, 0.0, 0.0, 0.0);
+ __asm vec4_seq __retVal, v, zero;
+}
+
+bvec4 __constructor(const ivec4 v)
+{
+ const ivec4 zero = ivec4(0, 0, 0, 0);
+ __asm vec4_seq __retVal, v, zero;
+}
+
//// mat2 constructors