const GLfloat b = pz * py;
const GLfloat c = px * px + py * py;
const GLfloat d = -(a * x0 + b * y0 + c * z0);
- if (a == 0.0 && b == 0.0 && c == 0.0 && d == 0.0) {
- plane[0] = 0.0;
- plane[1] = 0.0;
- plane[2] = 1.0;
- plane[3] = 0.0;
+ if (a == 0.0F && b == 0.0F && c == 0.0F && d == 0.0F) {
+ plane[0] = 0.0F;
+ plane[1] = 0.0F;
+ plane[2] = 1.0F;
+ plane[3] = 0.0F;
}
else {
plane[0] = a;
static inline void
constant_plane(GLfloat value, GLfloat plane[4])
{
- plane[0] = 0.0;
- plane[1] = 0.0;
- plane[2] = -1.0;
+ plane[0] = 0.0F;
+ plane[1] = 0.0F;
+ plane[2] = -1.0F;
plane[3] = value;
}
solve_plane_recip(GLfloat x, GLfloat y, const GLfloat plane[4])
{
const GLfloat denom = plane[3] + plane[0] * x + plane[1] * y;
- if (denom == 0.0)
- return 0.0;
+ if (denom == 0.0F)
+ return 0.0F;
else
return -plane[2] / denom;
}
if (x0 < x1) {
xLeft = x0 - line->halfWidth;
xRight = x1 + line->halfWidth;
- if (line->dy >= 0.0) {
+ if (line->dy >= 0.0F) {
yBot = y0 - 3.0F * line->halfWidth;
yTop = y0 + line->halfWidth;
}
else {
xLeft = x1 - line->halfWidth;
xRight = x0 + line->halfWidth;
- if (line->dy <= 0.0) {
+ if (line->dy <= 0.0F) {
yBot = y1 - 3.0F * line->halfWidth;
yTop = y1 + line->halfWidth;
}
if (y0 < y1) {
yBot = y0 - line->halfWidth;
yTop = y1 + line->halfWidth;
- if (line->dx >= 0.0) {
+ if (line->dx >= 0.0F) {
xLeft = x0 - 3.0F * line->halfWidth;
xRight = x0 + line->halfWidth;
}
else {
yBot = y1 - line->halfWidth;
yTop = y0 + line->halfWidth;
- if (line->dx <= 0.0) {
+ if (line->dx <= 0.0F) {
xLeft = x1 - 3.0F * line->halfWidth;
xRight = x1 + line->halfWidth;
}
(void) swrast;
- if (coverage == 0.0)
+ if (coverage == 0.0F)
return;
line->span.end++;
ctx->Const.MinLineWidthAA,
ctx->Const.MaxLineWidthAA);
- if (line.len == 0.0 || IS_INF_OR_NAN(line.len))
+ if (line.len == 0.0F || IS_INF_OR_NAN(line.len))
return;
INIT_SPAN(line.span, GL_LINE);
for (i = 0; i < 3; i++) {
dst[optype][i] =
(src[optype][2][i] >
- 0.5) ? src[optype][0][i] : src[optype][1][i];
+ 0.5F) ? src[optype][0][i] : src[optype][1][i];
}
}
else {
dst[optype][3] =
(src[optype][2][3] >
- 0.5) ? src[optype][0][3] : src[optype][1][3];
+ 0.5F) ? src[optype][0][3] : src[optype][1][3];
}
break;
GLint width, GLint height,
GLfloat zoomX, GLfloat zoomY)
{
- if (zoomX == 1.0 && zoomY == 1.0) {
+ if (zoomX == 1.0F && zoomY == 1.0F) {
return _mesa_regions_overlap(srcx, srcy, srcx + width, srcy + height,
dstx, dsty, dstx + width, dsty + height);
}
GLuint i;
if (depthMax <= 0xffffff &&
- ctx->Pixel.DepthScale == 1.0 &&
- ctx->Pixel.DepthBias == 0.0) {
+ ctx->Pixel.DepthScale == 1.0F &&
+ ctx->Pixel.DepthBias == 0.0F) {
/* no scale or bias and no clamping and no worry of overflow */
const GLfloat depthMaxF = ctx->DrawBuffer->_DepthMaxF;
for (i = 0; i < width; i++) {
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels )
{
- const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
const GLenum destType = GL_UNSIGNED_BYTE;
GLint row;
GLubyte *values;
const GLvoid *pixels )
{
const GLboolean scaleOrBias
- = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
- const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
+ = ctx->Pixel.DepthScale != 1.0f || ctx->Pixel.DepthBias != 0.0f;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0f || ctx->Pixel.ZoomY != 1.0f;
SWspan span;
INIT_SPAN(span, GL_BITMAP);
const GLvoid *pixels )
{
const GLint imgX = x, imgY = y;
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
GLbitfield transferOps = ctx->_ImageTransferState;
SWspan span;
{
const GLint imgX = x, imgY = y;
const GLboolean scaleOrBias
- = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
+ = ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F;
const GLuint stencilMask = ctx->Stencil.WriteMask[0];
const GLenum stencilType = GL_UNSIGNED_BYTE;
- const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
struct gl_renderbuffer *depthRb, *stencilRb;
struct gl_pixelstore_attrib clippedUnpack = *unpack;
/* Store result depth/z */
if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPTH][2];
- if (depth <= 0.0)
+ if (depth <= 0.0F)
span->array->z[i] = 0;
- else if (depth >= 1.0)
+ else if (depth >= 1.0F)
span->array->z[i] = ctx->DrawBuffer->_DepthMax;
else
span->array->z[i] =
USE(general_line);
}
else if (ctx->Depth.Test
- || ctx->Line.Width != 1.0
+ || ctx->Line.Width != 1.0F
|| ctx->Line.StippleFlag) {
/* no texture, but Z, fog, width>1, stipple, etc. */
#if CHAN_BITS == 32
}
else {
assert(!ctx->Depth.Test);
- assert(ctx->Line.Width == 1.0);
+ assert(ctx->Line.Width == 1.0F);
/* simple lines */
USE(simple_no_z_rgba_line);
}
else {
/* even size */
/* 0.501 factor allows conformance to pass */
- xmin = (GLint) (x + 0.501) - iRadius;
+ xmin = (GLint) (x + 0.501F) - iRadius;
xmax = xmin + iSize - 1;
- ymin = (GLint) (y + 0.501) - iRadius;
+ ymin = (GLint) (y + 0.501F) - iRadius;
ymax = ymin + iSize - 1;
}
else {
/* even size */
/* 0.501 factor allows conformance to pass */
- xmin = (GLint) (x + 0.501) - iRadius;
+ xmin = (GLint) (x + 0.501F) - iRadius;
xmax = xmin + iSize - 1;
- ymin = (GLint) (y + 0.501) - iRadius;
+ ymin = (GLint) (y + 0.501F) - iRadius;
ymax = ymin + iSize - 1;
}
else if (ctx->Point.SmoothFlag) {
swrast->Point = smooth_point;
}
- else if (size > 1.0 ||
+ else if (size > 1.0F ||
ctx->Point._Attenuated ||
ctx->VertexProgram.PointSizeEnabled) {
swrast->Point = large_point;
/* LOD is calculated directly in the ansiotropic filter, we can
* skip the normal lambda function as the result is ignored.
*/
- if (samp->MaxAnisotropy > 1.0 &&
+ if (samp->MaxAnisotropy > 1.0F &&
samp->MinFilter == GL_LINEAR_MIPMAP_LINEAR) {
needLambda = GL_FALSE;
}
GLubyte (*rgba)[4] = span->array->rgba8;
for (i = 0; i < span->end; i++) {
const GLfloat a = rgba[i][ACOMP] * coverage[i];
- rgba[i][ACOMP] = (GLubyte) CLAMP(a, 0.0, 255.0);
- assert(coverage[i] >= 0.0);
- assert(coverage[i] <= 1.0);
+ rgba[i][ACOMP] = (GLubyte) CLAMP(a, 0.0F, 255.0F);
+ assert(coverage[i] >= 0.0F);
+ assert(coverage[i] <= 1.0F);
}
}
else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
GLushort (*rgba)[4] = span->array->rgba16;
for (i = 0; i < span->end; i++) {
const GLfloat a = rgba[i][ACOMP] * coverage[i];
- rgba[i][ACOMP] = (GLushort) CLAMP(a, 0.0, 65535.0);
+ rgba[i][ACOMP] = (GLushort) CLAMP(a, 0.0F, 65535.0F);
}
}
else {
}
}
- if (samp->MinLod != -1000.0 ||
- samp->MaxLod != 1000.0) {
+ if (samp->MinLod != -1000.0F ||
+ samp->MaxLod != 1000.0F) {
/* apply LOD clamping to lambda */
const GLfloat min = samp->MinLod;
const GLfloat max = samp->MaxLod;
}
}
}
- else if (samp->MaxAnisotropy > 1.0 &&
+ else if (samp->MaxAnisotropy > 1.0F &&
samp->MinFilter == GL_LINEAR_MIPMAP_LINEAR) {
/* sample_lambda_2d_aniso is beeing used as texture_sample_func,
* it requires the current SWspan *span as an additional parameter.
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[u];
const GLboolean adjustLOD =
(texUnit->LodBias + samp->LodBias != 0.0F)
- || (samp->MinLod != -1000.0 || samp->MaxLod != 1000.0);
+ || (samp->MinLod != -1000.0F || samp->MaxLod != 1000.0F);
GLuint i;
ctx->Const.MaxTextureLodBias);
lod += bias;
- if (samp->MinLod != -1000.0 ||
- samp->MaxLod != 1000.0) {
+ if (samp->MinLod != -1000.0F ||
+ samp->MaxLod != 1000.0F) {
/* apply LOD clamping to lambda */
lod = CLAMP(lod, samp->MinLod, samp->MaxLod);
}
}
else if (needLambda) {
/* Anisotropic filtering extension. Activated only if mipmaps are used */
- if (sampler->MaxAnisotropy > 1.0 &&
+ if (sampler->MaxAnisotropy > 1.0F &&
sampler->MinFilter == GL_LINEAR_MIPMAP_LINEAR) {
return sample_lambda_2d_aniso;
}
if (IS_INF_OR_NAN(area) || area == 0.0F)
return;
- if (area * bf * swrast->_BackfaceCullSign < 0.0)
+ if (area * bf * swrast->_BackfaceCullSign < 0.0F)
return;
oneOverArea = 1.0F / area;
(zx - imageX) / zoomX = x - imageX;
*/
GLint x;
- if (zoomX < 0.0)
+ if (zoomX < 0.0F)
zx++;
x = imageX + (GLint) ((zx - imageX) / zoomX);
return x;