summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/slang/library/slang_common_builtin.gc20
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c2
2 files changed, 8 insertions, 14 deletions
diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc
index a25ca55bc4..d75354deff 100644
--- a/src/mesa/shader/slang/library/slang_common_builtin.gc
+++ b/src/mesa/shader/slang/library/slang_common_builtin.gc
@@ -605,7 +605,7 @@ float sqrt(const float x)
const float nx = -x;
float r;
__asm float_rsq r, x;
- __asm float_rcp r, r;
+ r = r * x;
__asm vec4_cmp __retVal, nx, r, 0.0;
}
@@ -615,8 +615,7 @@ vec2 sqrt(const vec2 x)
vec2 r;
__asm float_rsq r.x, x.x;
__asm float_rsq r.y, x.y;
- __asm float_rcp r.x, r.x;
- __asm float_rcp r.y, r.y;
+ r = r * x;
__asm vec4_cmp __retVal, nx, r, zero;
}
@@ -627,9 +626,7 @@ vec3 sqrt(const vec3 x)
__asm float_rsq r.x, x.x;
__asm float_rsq r.y, x.y;
__asm float_rsq r.z, x.z;
- __asm float_rcp r.x, r.x;
- __asm float_rcp r.y, r.y;
- __asm float_rcp r.z, r.z;
+ r = r * x;
__asm vec4_cmp __retVal, nx, r, zero;
}
@@ -641,10 +638,7 @@ vec4 sqrt(const vec4 x)
__asm float_rsq r.y, x.y;
__asm float_rsq r.z, x.z;
__asm float_rsq r.w, x.w;
- __asm float_rcp r.x, r.x;
- __asm float_rcp r.y, r.y;
- __asm float_rcp r.z, r.z;
- __asm float_rcp r.w, r.w;
+ r = r * x;
__asm vec4_cmp __retVal, nx, r, zero;
}
@@ -1166,7 +1160,7 @@ float length(const vec2 v)
float r;
const float p = dot(v, v); // p = v.x * v.x + v.y * v.y
__asm float_rsq r, p; // r = 1 / sqrt(p)
- __asm float_rcp __retVal.x, r; // retVal = 1 / r
+ __retVal = p * r; // p * r = sqrt(p);
}
float length(const vec3 v)
@@ -1174,7 +1168,7 @@ float length(const vec3 v)
float r;
const float p = dot(v, v); // p = v.x * v.x + v.y * v.y + v.z * v.z
__asm float_rsq r, p; // r = 1 / sqrt(p)
- __asm float_rcp __retVal, r; // retVal = 1 / r
+ __retVal = p * r; // p * r = sqrt(p);
}
float length(const vec4 v)
@@ -1182,7 +1176,7 @@ float length(const vec4 v)
float r;
const float p = dot(v, v); // p = v.x * v.x + v.y * v.y + ...
__asm float_rsq r, p; // r = 1 / sqrt(p)
- __asm float_rcp __retVal, r; // retVal = 1 / r
+ __retVal = p * r; // p * r = sqrt(p);
}
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 8cdd3ff2ae..390ada5489 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -934,7 +934,7 @@ st_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
GLubyte *dest;
if (stImage->pt &&
- util_format_is_compressed(stImage->pt->format) &&
+ util_format_is_s3tc(stImage->pt->format) &&
!compressed_dst) {
/* Need to decompress the texture.
* We'll do this by rendering a textured quad.