summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_aaline.c28
-rw-r--r--src/mesa/swrast/s_aalinetemp.h4
-rw-r--r--src/mesa/swrast/s_atifragshader.c4
-rw-r--r--src/mesa/swrast/s_copypix.c22
-rw-r--r--src/mesa/swrast/s_depth.c14
-rw-r--r--src/mesa/swrast/s_drawpix.c12
-rw-r--r--src/mesa/swrast/s_fragprog.c4
-rw-r--r--src/mesa/swrast/s_lines.c4
-rw-r--r--src/mesa/swrast/s_points.c10
-rw-r--r--src/mesa/swrast/s_span.c10
-rw-r--r--src/mesa/swrast/s_texcombine.c6
-rw-r--r--src/mesa/swrast/s_texfilter.c64
-rw-r--r--src/mesa/swrast/s_tritemp.h2
-rw-r--r--src/mesa/swrast/s_zoom.c2
14 files changed, 93 insertions, 93 deletions
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c
index f3258e813a6..de5b42b9f6b 100644
--- a/src/mesa/swrast/s_aaline.c
+++ b/src/mesa/swrast/s_aaline.c
@@ -116,11 +116,11 @@ compute_plane(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1,
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;
@@ -135,9 +135,9 @@ compute_plane(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1,
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;
}
@@ -160,8 +160,8 @@ static inline GLfloat
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;
}
@@ -374,7 +374,7 @@ segment(struct gl_context *ctx,
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;
}
@@ -386,7 +386,7 @@ segment(struct gl_context *ctx,
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;
}
@@ -420,7 +420,7 @@ segment(struct gl_context *ctx,
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;
}
@@ -432,7 +432,7 @@ segment(struct gl_context *ctx,
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;
}
diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
index f1d078fd89b..bebb131a5d1 100644
--- a/src/mesa/swrast/s_aalinetemp.h
+++ b/src/mesa/swrast/s_aalinetemp.h
@@ -44,7 +44,7 @@ NAME(plot)(struct gl_context *ctx, struct LineInfo *line, int ix, int iy)
(void) swrast;
- if (coverage == 0.0)
+ if (coverage == 0.0F)
return;
line->span.end++;
@@ -123,7 +123,7 @@ NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
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);
diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c
index 9e029db25ce..2974deed41b 100644
--- a/src/mesa/swrast/s_atifragshader.c
+++ b/src/mesa/swrast/s_atifragshader.c
@@ -436,13 +436,13 @@ execute_shader(struct gl_context *ctx, const struct ati_fragment_shader *shader,
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;
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 68c83e44e12..0dbccc0f61d 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -27,6 +27,7 @@
#include "main/context.h"
#include "main/condrender.h"
#include "main/macros.h"
+#include "main/blit.h"
#include "main/pixeltransfer.h"
#include "main/imports.h"
@@ -51,20 +52,9 @@ regions_overlap(GLint srcx, GLint srcy,
GLint width, GLint height,
GLfloat zoomX, GLfloat zoomY)
{
- if (zoomX == 1.0 && zoomY == 1.0) {
- /* no zoom */
- if (srcx >= dstx + width || (srcx + width <= dstx)) {
- return GL_FALSE;
- }
- else if (srcy < dsty) { /* this is OK */
- return GL_FALSE;
- }
- else if (srcy > dsty + height) {
- return GL_FALSE;
- }
- else {
- return GL_TRUE;
- }
+ if (zoomX == 1.0F && zoomY == 1.0F) {
+ return _mesa_regions_overlap(srcx, srcy, srcx + width, srcy + height,
+ dstx, dsty, dstx + width, dsty + height);
}
else {
/* add one pixel of slop when zooming, just to be safe */
@@ -211,8 +201,8 @@ scale_and_bias_z(struct gl_context *ctx, GLuint width,
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++) {
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 134f897c039..ffadc05a732 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -419,8 +419,8 @@ _swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span )
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
GLubyte *zStart;
- GLuint zMin = (GLuint) (ctx->Depth.BoundsMin * fb->_DepthMaxF + 0.5F);
- GLuint zMax = (GLuint) (ctx->Depth.BoundsMax * fb->_DepthMaxF + 0.5F);
+ GLuint zMin = (GLuint)((double)ctx->Depth.BoundsMin * 0xffffffff);
+ GLuint zMax = (GLuint)((double)ctx->Depth.BoundsMax * 0xffffffff);
GLubyte *mask = span->array->mask;
const GLuint count = span->end;
GLuint i;
@@ -444,6 +444,16 @@ _swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span )
zBufferVals = (const GLuint *) zStart;
}
else {
+ /* Round the bounds to the precision of the zbuffer. */
+ if (rb->Format == MESA_FORMAT_Z_UNORM16) {
+ zMin = (zMin & 0xffff0000) | (zMin >> 16);
+ zMax = (zMax & 0xffff0000) | (zMax >> 16);
+ } else {
+ /* 24 bits */
+ zMin = (zMin & 0xffffff00) | (zMin >> 24);
+ zMax = (zMax & 0xffffff00) | (zMax >> 24);
+ }
+
/* unpack Z values into a temporary array */
if (span->arrayMask & SPAN_XY) {
get_z32_values(ctx, rb, count, span->array->x, span->array->y,
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index fb677ee1b16..dc6827ede9f 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -264,7 +264,7 @@ draw_stencil_pixels( struct gl_context *ctx, GLint x, GLint y,
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;
@@ -309,8 +309,8 @@ draw_depth_pixels( struct gl_context *ctx, GLint x, GLint y,
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);
@@ -415,7 +415,7 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
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;
@@ -601,10 +601,10 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
{
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;
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 175915a5a0b..4fbf66b9db7 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -243,9 +243,9 @@ run_program(struct gl_context *ctx, SWspan *span, GLuint start, GLuint end)
/* 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] =
diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c
index 58bd2fc720a..ab8da7db289 100644
--- a/src/mesa/swrast/s_lines.c
+++ b/src/mesa/swrast/s_lines.c
@@ -241,7 +241,7 @@ _swrast_choose_line( struct gl_context *ctx )
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
@@ -252,7 +252,7 @@ _swrast_choose_line( struct gl_context *ctx )
}
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);
}
diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c
index 2212c95fa9a..d9aae73302c 100644
--- a/src/mesa/swrast/s_points.c
+++ b/src/mesa/swrast/s_points.c
@@ -208,9 +208,9 @@ sprite_point(struct gl_context *ctx, const SWvertex *vert)
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;
}
@@ -423,9 +423,9 @@ large_point(struct gl_context *ctx, const SWvertex *vert)
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;
}
@@ -552,7 +552,7 @@ _swrast_choose_point(struct gl_context *ctx)
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;
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 3db10e163d7..cd939ba9510 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -506,7 +506,7 @@ interpolate_texcoords(struct gl_context *ctx, SWspan *span)
/* 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;
}
@@ -886,16 +886,16 @@ apply_aa_coverage(SWspan *span)
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 {
diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c
index 453bd36367b..da4a013634c 100644
--- a/src/mesa/swrast/s_texcombine.c
+++ b/src/mesa/swrast/s_texcombine.c
@@ -670,8 +670,8 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
}
}
- 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;
@@ -682,7 +682,7 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
}
}
}
- 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.
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index abc1727cf29..314170fc751 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -1902,7 +1902,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx,
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;
@@ -1973,8 +1973,8 @@ sample_lambda_2d_aniso(struct gl_context *ctx,
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);
}
@@ -3713,7 +3713,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
const struct gl_sampler_object *sampler)
{
if (!t || !_mesa_is_texture_complete(t, sampler)) {
- return &null_sample_func;
+ return null_sample_func;
}
else {
const GLboolean needLambda =
@@ -3722,32 +3722,32 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
switch (t->Target) {
case GL_TEXTURE_1D:
if (is_depth_texture(t)) {
- return &sample_depth_texture;
+ return sample_depth_texture;
}
else if (needLambda) {
- return &sample_lambda_1d;
+ return sample_lambda_1d;
}
else if (sampler->MinFilter == GL_LINEAR) {
- return &sample_linear_1d;
+ return sample_linear_1d;
}
else {
assert(sampler->MinFilter == GL_NEAREST);
- return &sample_nearest_1d;
+ return sample_nearest_1d;
}
case GL_TEXTURE_2D:
if (is_depth_texture(t)) {
- return &sample_depth_texture;
+ return sample_depth_texture;
}
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;
+ return sample_lambda_2d_aniso;
}
- return &sample_lambda_2d;
+ return sample_lambda_2d;
}
else if (sampler->MinFilter == GL_LINEAR) {
- return &sample_linear_2d;
+ return sample_linear_2d;
}
else {
/* check for a few optimized cases */
@@ -3772,72 +3772,72 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
}
case GL_TEXTURE_3D:
if (needLambda) {
- return &sample_lambda_3d;
+ return sample_lambda_3d;
}
else if (sampler->MinFilter == GL_LINEAR) {
- return &sample_linear_3d;
+ return sample_linear_3d;
}
else {
assert(sampler->MinFilter == GL_NEAREST);
- return &sample_nearest_3d;
+ return sample_nearest_3d;
}
case GL_TEXTURE_CUBE_MAP:
if (needLambda) {
- return &sample_lambda_cube;
+ return sample_lambda_cube;
}
else if (sampler->MinFilter == GL_LINEAR) {
- return &sample_linear_cube;
+ return sample_linear_cube;
}
else {
assert(sampler->MinFilter == GL_NEAREST);
- return &sample_nearest_cube;
+ return sample_nearest_cube;
}
case GL_TEXTURE_RECTANGLE_NV:
if (is_depth_texture(t)) {
- return &sample_depth_texture;
+ return sample_depth_texture;
}
else if (needLambda) {
- return &sample_lambda_rect;
+ return sample_lambda_rect;
}
else if (sampler->MinFilter == GL_LINEAR) {
- return &sample_linear_rect;
+ return sample_linear_rect;
}
else {
assert(sampler->MinFilter == GL_NEAREST);
- return &sample_nearest_rect;
+ return sample_nearest_rect;
}
case GL_TEXTURE_1D_ARRAY_EXT:
if (is_depth_texture(t)) {
- return &sample_depth_texture;
+ return sample_depth_texture;
}
else if (needLambda) {
- return &sample_lambda_1d_array;
+ return sample_lambda_1d_array;
}
else if (sampler->MinFilter == GL_LINEAR) {
- return &sample_linear_1d_array;
+ return sample_linear_1d_array;
}
else {
assert(sampler->MinFilter == GL_NEAREST);
- return &sample_nearest_1d_array;
+ return sample_nearest_1d_array;
}
case GL_TEXTURE_2D_ARRAY_EXT:
if (is_depth_texture(t)) {
- return &sample_depth_texture;
+ return sample_depth_texture;
}
else if (needLambda) {
- return &sample_lambda_2d_array;
+ return sample_lambda_2d_array;
}
else if (sampler->MinFilter == GL_LINEAR) {
- return &sample_linear_2d_array;
+ return sample_linear_2d_array;
}
else {
assert(sampler->MinFilter == GL_NEAREST);
- return &sample_nearest_2d_array;
+ return sample_nearest_2d_array;
}
default:
_mesa_problem(ctx,
"invalid target in _swrast_choose_texture_sample_func");
- return &null_sample_func;
+ return null_sample_func;
}
}
}
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index fddbbfd99d6..1d71839713c 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -242,7 +242,7 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
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;
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index 9879e2a5f10..34b8eb19657 100644
--- a/src/mesa/swrast/s_zoom.c
+++ b/src/mesa/swrast/s_zoom.c
@@ -114,7 +114,7 @@ unzoom_x(GLfloat zoomX, GLint imageX, GLint zx)
(zx - imageX) / zoomX = x - imageX;
*/
GLint x;
- if (zoomX < 0.0)
+ if (zoomX < 0.0F)
zx++;
x = imageX + (GLint) ((zx - imageX) / zoomX);
return x;