summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pack.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2015-07-12 23:15:42 -0700
committerMatt Turner <mattst88@gmail.com>2015-07-29 09:34:52 -0700
commita562313f378a056c8d886e418b518063ab077c39 (patch)
tree1d89ad9d8cd183bbcb560262105625b771799ecf /src/mesa/main/pack.c
parent7adc9fa1f1d12683c5855bf5854dec814629093d (diff)
downloadexternal_mesa3d-a562313f378a056c8d886e418b518063ab077c39.zip
external_mesa3d-a562313f378a056c8d886e418b518063ab077c39.tar.gz
external_mesa3d-a562313f378a056c8d886e418b518063ab077c39.tar.bz2
mesa: Avoid double promotion.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/mesa/main/pack.c')
-rw-r--r--src/mesa/main/pack.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index f723608..fb642b8 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -796,7 +796,7 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n,
* back to an int type can introduce errors that will show up as
* artifacts in things like depth peeling which uses glCopyTexImage.
*/
- if (ctx->Pixel.DepthScale == 1.0 && ctx->Pixel.DepthBias == 0.0) {
+ if (ctx->Pixel.DepthScale == 1.0F && ctx->Pixel.DepthBias == 0.0F) {
if (srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_SHORT) {
const GLuint *src = (const GLuint *) source;
GLushort *dst = (GLushort *) dest;
@@ -874,8 +874,8 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n,
case GL_UNSIGNED_INT_24_8_EXT: /* GL_EXT_packed_depth_stencil */
if (dstType == GL_UNSIGNED_INT_24_8_EXT &&
depthMax == 0xffffff &&
- ctx->Pixel.DepthScale == 1.0 &&
- ctx->Pixel.DepthBias == 0.0) {
+ ctx->Pixel.DepthScale == 1.0F &&
+ ctx->Pixel.DepthBias == 0.0F) {
const GLuint *src = (const GLuint *) source;
GLuint *zValues = (GLuint *) dest;
GLuint i;
@@ -945,7 +945,7 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n,
{
const GLfloat scale = ctx->Pixel.DepthScale;
const GLfloat bias = ctx->Pixel.DepthBias;
- if (scale != 1.0 || bias != 0.0) {
+ if (scale != 1.0F || bias != 0.0F) {
GLuint i;
for (i = 0; i < n; i++) {
depthValues[i] = depthValues[i] * scale + bias;
@@ -958,7 +958,7 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n,
if (needClamp) {
GLuint i;
for (i = 0; i < n; i++) {
- depthValues[i] = (GLfloat)CLAMP(depthValues[i], 0.0, 1.0);
+ depthValues[i] = CLAMP(depthValues[i], 0.0F, 1.0F);
}
}
@@ -1025,7 +1025,7 @@ _mesa_pack_depth_span( struct gl_context *ctx, GLuint n, GLvoid *dest,
return;
}
- if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) {
+ if (ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F) {
memcpy(depthCopy, depthSpan, n * sizeof(GLfloat));
_mesa_scale_and_bias_depth(ctx, n, depthCopy);
depthSpan = depthCopy;
@@ -1153,7 +1153,7 @@ _mesa_pack_depth_stencil_span(struct gl_context *ctx,GLuint n,
return;
}
- if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) {
+ if (ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F) {
memcpy(depthCopy, depthVals, n * sizeof(GLfloat));
_mesa_scale_and_bias_depth(ctx, n, depthCopy);
depthVals = depthCopy;