diff options
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/slang/library/slang_common_builtin.gc | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 18b38af758..e908e6c940 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -872,35 +872,29 @@ vec4 mod(const vec4 a, const float b) vec2 mod(const vec2 a, const vec2 b) { - float oneOverBx, oneOverBy; - __asm float_rcp oneOverBx, b.x; - __asm float_rcp oneOverBy, b.y; - __retVal.x = a.x - b.x * floor(a.x * oneOverBx); - __retVal.y = a.y - b.y * floor(a.y * oneOverBy); + vec2 oneOverB; + __asm float_rcp oneOverB.x, b.x; + __asm float_rcp oneOverB.y, b.y; + __retVal = a - b * floor(a * oneOverB); } vec3 mod(const vec3 a, const vec3 b) { - float oneOverBx, oneOverBy, oneOverBz; - __asm float_rcp oneOverBx, b.x; - __asm float_rcp oneOverBy, b.y; - __asm float_rcp oneOverBz, b.z; - __retVal.x = a.x - b.x * floor(a.x * oneOverBx); - __retVal.y = a.y - b.y * floor(a.y * oneOverBy); - __retVal.z = a.z - b.z * floor(a.z * oneOverBz); + vec3 oneOverB; + __asm float_rcp oneOverB.x, b.x; + __asm float_rcp oneOverB.y, b.y; + __asm float_rcp oneOverB.z, b.z; + __retVal = a - b * floor(a * oneOverB); } vec4 mod(const vec4 a, const vec4 b) { - float oneOverBx, oneOverBy, oneOverBz, oneOverBw; - __asm float_rcp oneOverBx, b.x; - __asm float_rcp oneOverBy, b.y; - __asm float_rcp oneOverBz, b.z; - __asm float_rcp oneOverBw, b.w; - __retVal.x = a.x - b.x * floor(a.x * oneOverBx); - __retVal.y = a.y - b.y * floor(a.y * oneOverBy); - __retVal.z = a.z - b.z * floor(a.z * oneOverBz); - __retVal.w = a.w - b.w * floor(a.w * oneOverBw); + vec4 oneOverB; + __asm float_rcp oneOverB.x, b.x; + __asm float_rcp oneOverB.y, b.y; + __asm float_rcp oneOverB.z, b.z; + __asm float_rcp oneOverB.w, b.w; + __retVal = a - b * floor(a * oneOverB); } |