Reported by Karl Schultz.
#if defined(DO_ATTRIBS)
/* compute attributes at left-most fragment */
- span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 0.5, iy + 0.5, wPlane);
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 0.5F, iy + 0.5F, wPlane);
ATTRIB_LOOP_BEGIN
GLuint c;
for (c = 0; c < 4; c++) {
- span.attrStart[attr][c] = solve_plane(ix + 0.5, iy + 0.5, attrPlane[attr][c]);
+ span.attrStart[attr][c] = solve_plane(ix + 0.5F, iy + 0.5F, attrPlane[attr][c]);
}
ATTRIB_LOOP_END
#endif
#if defined(DO_ATTRIBS)
/* compute attributes at left-most fragment */
- span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5, iy + 0.5, wPlane);
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5, iy + 0.5F, wPlane);
ATTRIB_LOOP_BEGIN
GLuint c;
for (c = 0; c < 4; c++) {
- span.attrStart[attr][c] = solve_plane(ix + 1.5, iy + 0.5, attrPlane[attr][c]);
+ span.attrStart[attr][c] = solve_plane(ix + 1.5, iy + 0.5F, attrPlane[attr][c]);
}
ATTRIB_LOOP_END
#endif
/* XXX this would have to change for accum buffers with more or less
* than 16 bits per color channel.
*/
-#define ACCUM_SCALE16 32767.0
+#define ACCUM_SCALE16 32767.0F
/*
ALPHA_TEST(FixedToInt(alpha), alpha += alphaStep);
}
else {
- const GLfloat alphaStep = span->alphaStep;
- GLfloat alpha = span->alpha;
+ const GLfloat alphaStep = FIXED_TO_FLOAT(span->alphaStep);
+ GLfloat alpha = FIXED_TO_FLOAT(span->alpha);
const GLfloat ref = ctx->Color.AlphaRef;
ALPHA_TEST(alpha, alpha += alphaStep);
}
break;
case GL_SWIZZLE_STQ_DQ_ATI:
/* make sure q is not 0 to avoid problems later with infinite values (texture lookup)? */
- if (q == 0.0F) q = 0.000000001;
+ if (q == 0.0F)
+ q = 0.000000001F;
values[0] = s / q;
values[1] = t / q;
- values[2] = 1 / q;
+ values[2] = 1.0 / q;
break;
}
values[3] = 0.0;
val[i] = 8 * val[i];
break;
case GL_HALF_BIT_ATI:
- val[i] = val[i] * 0.5;
+ val[i] = val[i] * 0.5F;
break;
case GL_QUARTER_BIT_ATI:
- val[i] = val[i] * 0.25;
+ val[i] = val[i] * 0.25F;
break;
case GL_EIGHTH_BIT_ATI:
- val[i] = val[i] * 0.125;
+ val[i] = val[i] * 0.125F;
break;
}
if (has_sat) {
- if (val[i] < 0.0)
- val[i] = 0;
- else if (val[i] > 1.0)
- val[i] = 1.0;
+ if (val[i] < 0.0F)
+ val[i] = 0.0F;
+ else if (val[i] > 1.0F)
+ val[i] = 1.0F;
}
else {
- if (val[i] < -8.0)
- val[i] = -8.0;
- else if (val[i] > 8.0)
- val[i] = 8.0;
+ if (val[i] < -8.0F)
+ val[i] = -8.0F;
+ else if (val[i] > 8.0F)
+ val[i] = 8.0F;
}
}
}
if (ctx->Polygon.CullFlag) {
switch (ctx->Polygon.CullFaceMode) {
case GL_BACK:
- backface_sign = -1.0;
+ backface_sign = -1.0F;
break;
case GL_FRONT:
- backface_sign = 1.0;
+ backface_sign = 1.0F;
break;
case GL_FRONT_AND_BACK:
/* fallthrough */
default:
- backface_sign = 0.0;
+ backface_sign = 0.0F;
}
}
else {
- backface_sign = 0.0;
+ backface_sign = 0.0F;
}
SWRAST_CONTEXT(ctx)->_BackfaceCullSign = backface_sign;
/* This is for front/back-face determination, but not for culling */
SWRAST_CONTEXT(ctx)->_BackfaceSign
- = (ctx->Polygon.FrontFace == GL_CW) ? -1.0 : 1.0;
+ = (ctx->Polygon.FrontFace == GL_CW) ? -1.0F : 1.0F;
}
/* compute (scaled) fog color */
if (span->array->ChanType == GL_UNSIGNED_BYTE) {
- rFog = ctx->Fog.Color[RCOMP] * 255.0;
- gFog = ctx->Fog.Color[GCOMP] * 255.0;
- bFog = ctx->Fog.Color[BCOMP] * 255.0;
+ rFog = ctx->Fog.Color[RCOMP] * 255.0F;
+ gFog = ctx->Fog.Color[GCOMP] * 255.0F;
+ bFog = ctx->Fog.Color[BCOMP] * 255.0F;
}
else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
- rFog = ctx->Fog.Color[RCOMP] * 65535.0;
- gFog = ctx->Fog.Color[GCOMP] * 65535.0;
- bFog = ctx->Fog.Color[BCOMP] * 65535.0;
+ rFog = ctx->Fog.Color[RCOMP] * 65535.0F;
+ gFog = ctx->Fog.Color[GCOMP] * 65535.0F;
+ bFog = ctx->Fog.Color[BCOMP] * 65535.0F;
}
else {
rFog = ctx->Fog.Color[RCOMP];
if (program->OriginUpperLeft)
wpos[1] = ctx->DrawBuffer->Height - 1 - wpos[1];
if (!program->PixelCenterInteger) {
- wpos[0] += 0.5;
- wpos[1] += 0.5;
+ wpos[0] += 0.5F;
+ wpos[1] += 0.5F;
}
/* Setup pointer to input attributes */
/* if running a GLSL program (not ARB_fragment_program) */
if (ctx->Shader.CurrentProgram) {
/* Store front/back facing value */
- machine->Attribs[FRAG_ATTRIB_FACE][col][0] = 1.0 - span->facing;
+ machine->Attribs[FRAG_ATTRIB_FACE][col][0] = 1.0F - span->facing;
}
machine->CurElement = col;
GLfloat s, r, dsdx;
/* texcoord / pointcoord interpolants */
- s = 0.0;
- dsdx = 1.0 / size;
+ s = 0.0F;
+ dsdx = 1.0F / size;
if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) {
- dtdy = 1.0 / size;
- t0 = 0.5 * dtdy;
+ dtdy = 1.0F / size;
+ t0 = 0.5F * dtdy;
}
else {
/* GL_UPPER_LEFT */
- dtdy = -1.0 / size;
- t0 = 1.0 + 0.5 * dtdy;
+ dtdy = -1.0F / size;
+ t0 = 1.0F + 0.5F * dtdy;
}
ATTRIB_LOOP_BEGIN
{
GLfloat (*wpos)[4] = span->array->attribs[FRAG_ATTRIB_WPOS];
GLuint i;
- const GLfloat zScale = 1.0 / ctx->DrawBuffer->_DepthMaxF;
+ const GLfloat zScale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
GLfloat w, dw;
if (span->arrayMask & SPAN_XY) {
/* (a * b) + (c * d) - 0.5 */
for (i = 0; i < n; i++) {
rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] +
- arg2[i][RCOMP] * arg3[i][RCOMP] - 0.5) * scaleRGB;
+ arg2[i][RCOMP] * arg3[i][RCOMP] - 0.5F) * scaleRGB;
rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] +
- arg2[i][GCOMP] * arg3[i][GCOMP] - 0.5) * scaleRGB;
+ arg2[i][GCOMP] * arg3[i][GCOMP] - 0.5F) * scaleRGB;
rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] +
- arg2[i][BCOMP] * arg3[i][BCOMP] - 0.5) * scaleRGB;
+ arg2[i][BCOMP] * arg3[i][BCOMP] - 0.5F) * scaleRGB;
}
}
else {
for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5) * scaleRGB;
- rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * scaleRGB;
- rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * scaleRGB;
+ rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5F) * scaleRGB;
+ rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5F) * scaleRGB;
+ rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5F) * scaleRGB;
}
}
break;
case GL_MODULATE_SIGNED_ADD_ATI:
for (i = 0; i < n; i++) {
rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) +
- arg1[i][RCOMP] - 0.5) * scaleRGB;
+ arg1[i][RCOMP] - 0.5F) * scaleRGB;
rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) +
- arg1[i][GCOMP] - 0.5) * scaleRGB;
+ arg1[i][GCOMP] - 0.5F) * scaleRGB;
rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) +
- arg1[i][BCOMP] - 0.5) * scaleRGB;
+ arg1[i][BCOMP] - 0.5F) * scaleRGB;
}
break;
case GL_MODULATE_SUBTRACT_ATI:
for (i = 0; i < n; i++) {
rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] +
arg2[i][ACOMP] * arg3[i][ACOMP] -
- 0.5) * scaleA;
+ 0.5F) * scaleA;
}
}
else {
switch (wrapMode) {
case GL_CLAMP:
/* Not exactly what the spec says, but it matches NVIDIA output */
- fcol = CLAMP(coord - 0.5F, 0.0, max-1);
+ fcol = CLAMP(coord - 0.5F, 0.0F, max - 1);
i0 = IFLOOR(fcol);
i1 = i0 + 1;
break;