summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/library/slang_core.gc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/slang/library/slang_core.gc')
-rw-r--r--src/mesa/shader/slang/library/slang_core.gc69
1 files changed, 58 insertions, 11 deletions
diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc
index ffa57f74c2..0fd2b7e6b3 100644
--- a/src/mesa/shader/slang/library/slang_core.gc
+++ b/src/mesa/shader/slang/library/slang_core.gc
@@ -113,13 +113,13 @@ int __constructor(const float f)
bool __constructor(const int i)
{
const float zero = 0.0;
- __asm vec4_seq __retVal, i, zero;
+ __asm vec4_sne __retVal, i, zero;
}
bool __constructor(const float f)
{
const float zero = 0.0;
- __asm vec4_seq __retVal, i, zero;
+ __asm vec4_sne __retVal, f, zero;
}
int __constructor(const bool b)
@@ -249,6 +249,14 @@ vec4 __constructor(const vec3 v3, const float f)
__retVal.w = f;
}
+vec4 __constructor(const vec2 v2, const float f1, const float f2)
+{
+ // XXX this constructor shouldn't be needed anymore
+ __retVal.xy = v2;
+ __retVal.z = f1;
+ __retVal.w = f2;
+}
+
//// ivec2 constructors
@@ -341,15 +349,28 @@ bvec2 __constructor(const bool b)
bvec2 __constructor(const float f)
{
const vec2 zero = vec2(0.0, 0.0);
- __asm vec4_seq __retVal.xy, f.xx, zero;
+ __asm vec4_sne __retVal.xy, f.xx, zero;
}
bvec2 __constructor(const int i)
{
const ivec2 zero = ivec2(0, 0);
- __asm vec4_seq __retVal.xy, i.xx, zero;
+ __asm vec4_sne __retVal.xy, i.xx, zero;
}
+bvec2 __constructor(const vec2 v)
+{
+ const vec2 zero = vec2(0.0, 0.0);
+ __asm vec4_sne __retVal.xy, v, zero;
+}
+
+bvec2 __constructor(const ivec2 v)
+{
+ const ivec2 zero = ivec2(0, 0);
+ __asm vec4_sne __retVal.xy, v, zero;
+}
+
+
//// bvec3 constructors
@@ -368,15 +389,28 @@ bvec3 __constructor(const bool b)
bvec3 __constructor(const float f)
{
const vec3 zero = vec3(0.0, 0.0, 0.0);
- __asm vec4_seq __retVal.xyz, f.xxx, zero;
+ __asm vec4_sne __retVal.xyz, f.xxx, zero;
}
bvec3 __constructor(const int i)
{
const ivec3 zero = ivec3(0, 0, 0);
- __asm vec4_seq __retVal.xyz, i.xxx, zero;
+ __asm vec4_sne __retVal.xyz, i.xxx, zero;
}
+bvec3 __constructor(const vec3 v)
+{
+ const vec3 zero = vec3(0.0, 0.0, 0.0);
+ __asm vec4_sne __retVal.xyz, v, zero;
+}
+
+bvec3 __constructor(const ivec3 v)
+{
+ const ivec3 zero = ivec3(0, 0, 0);
+ __asm vec4_sne __retVal.xyz, v, zero;
+}
+
+
//// bvec4 constructors
@@ -396,13 +430,25 @@ bvec4 __constructor(const bool b)
bvec4 __constructor(const float f)
{
const vec4 zero = vec4(0.0, 0.0, 0.0, 0.0);
- __asm vec4_seq __retVal, f.xxxx, zero;
+ __asm vec4_sne __retVal, f.xxxx, zero;
}
bvec4 __constructor(const int i)
{
const ivec4 zero = ivec4(0, 0, 0, 0);
- __asm vec4_seq __retVal, i.xxxx, zero;
+ __asm vec4_sne __retVal, i.xxxx, zero;
+}
+
+bvec4 __constructor(const vec4 v)
+{
+ const vec4 zero = vec4(0.0, 0.0, 0.0, 0.0);
+ __asm vec4_sne __retVal, v, zero;
+}
+
+bvec4 __constructor(const ivec4 v)
+{
+ const ivec4 zero = ivec4(0, 0, 0, 0);
+ __asm vec4_sne __retVal, v, zero;
}
@@ -1180,6 +1226,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;
}
@@ -1472,7 +1519,7 @@ void __operator /= (inout vec2 v, const float a)
{
float invA;
__asm float_rcp invA, a;
- __asm vec4_multiply v.xy, v.xy, a.xx;
+ __asm vec4_multiply v.xy, v.xy, invA.xx;
}
@@ -1497,7 +1544,7 @@ void __operator /= (inout vec3 v, const float a)
{
float invA;
__asm float_rcp invA, a;
- __asm vec4_multiply v.xyz, v.xyz, a.xxx;
+ __asm vec4_multiply v.xyz, v.xyz, invA.xxx;
}
@@ -1522,7 +1569,7 @@ void __operator /= (inout vec4 v, const float a)
{
float invA;
__asm float_rcp invA, a;
- __asm vec4_multiply v, v, a.xxxx;
+ __asm vec4_multiply v, v, invA.xxxx;
}