From: Brian Paul Date: Fri, 18 Jul 2008 18:52:24 +0000 (-0600) Subject: mesa: fix some GLSL /= int operators X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=378017417a7a0b7b8e25b6e859e9dcb92ef24ea9;p=mesa.git mesa: fix some GLSL /= int operators plus add a few more special constructors to improve code quality. --- diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc index 0fd2b7e6b33..2c3a5a6c452 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)