diff options
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_clear.c | 2 | ||||
-rw-r--r-- | src/mesa/swrast/s_context.c | 6 | ||||
-rw-r--r-- | src/mesa/swrast/s_copypix.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_depth.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_drawpix.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_logic.c | 2 | ||||
-rw-r--r-- | src/mesa/swrast/s_renderbuffer.c | 8 | ||||
-rw-r--r-- | src/mesa/swrast/s_span.c | 8 | ||||
-rw-r--r-- | src/mesa/swrast/s_stencil.c | 6 | ||||
-rw-r--r-- | src/mesa/swrast/s_texcombine.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_texfilter.c | 44 | ||||
-rw-r--r-- | src/mesa/swrast/s_texture.c | 1 | ||||
-rw-r--r-- | src/mesa/swrast/s_triangle.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_zoom.c | 2 |
14 files changed, 50 insertions, 49 deletions
diff --git a/src/mesa/swrast/s_clear.c b/src/mesa/swrast/s_clear.c index 158e5dace16..e409be3c05f 100644 --- a/src/mesa/swrast/s_clear.c +++ b/src/mesa/swrast/s_clear.c @@ -27,7 +27,7 @@ #include "main/condrender.h" #include "main/format_pack.h" #include "main/macros.h" -#include "util/imports.h" + #include "main/mtypes.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 0f58376382f..b06e81533a6 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -26,7 +26,7 @@ */ #include "main/errors.h" -#include "util/imports.h" + #include "main/bufferobj.h" #include "main/mtypes.h" #include "main/samplerobj.h" @@ -582,7 +582,7 @@ _swrast_validate_derived( struct gl_context *ctx ) _NEW_TEXTURE)) _swrast_update_active_attribs(ctx); - if (swrast->NewState & (_NEW_FOG | + if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM | _NEW_LIGHT | _NEW_TEXTURE)) @@ -893,7 +893,7 @@ _swrast_render_start( struct gl_context *ctx ) swrast->Driver.SpanRenderStart( ctx ); swrast->PointSpan.end = 0; } - + void _swrast_render_finish( struct gl_context *ctx ) { diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index acfa472066f..fc378a657f7 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -29,7 +29,7 @@ #include "main/macros.h" #include "main/blit.h" #include "main/pixeltransfer.h" -#include "util/imports.h" + #include "s_context.h" #include "s_depth.h" @@ -618,7 +618,7 @@ _swrast_CopyPixels(struct gl_context *ctx, { SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_renderbuffer *rb; - + if (!_mesa_check_conditional_render(ctx)) return; /* don't copy */ diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index fcf534428a1..7af764f671b 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -29,7 +29,7 @@ #include "main/format_unpack.h" #include "main/format_pack.h" #include "main/macros.h" -#include "util/imports.h" + #include "s_context.h" #include "s_depth.h" @@ -182,7 +182,7 @@ _swrast_depth_clamp_span( struct gl_context *ctx, SWspan *span ) /* Convert floating point values in [0,1] to device Z coordinates in * [0, DepthMax]. * ex: If the Z buffer has 24 bits, DepthMax = 0xffffff. - * + * * XXX this all falls apart if we have 31 or more bits of Z because * the triangle rasterization code produces unsigned Z values. Negative * vertex Z values come out as large fragment Z uints. diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 253d70cbbf2..31c6a6a971a 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -32,7 +32,7 @@ #include "main/format_utils.h" #include "main/glformats.h" #include "main/image.h" -#include "util/imports.h" + #include "main/macros.h" #include "main/pack.h" #include "main/pbo.h" @@ -623,7 +623,7 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, return; } } - + depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; assert(depthRb); diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index 6571acbba69..304e3d5312c 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -25,7 +25,7 @@ #include "main/glheader.h" #include "main/context.h" -#include "util/imports.h" + #include "main/macros.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c index df92b3c7575..27e2fce3cb0 100644 --- a/src/mesa/swrast/s_renderbuffer.c +++ b/src/mesa/swrast/s_renderbuffer.c @@ -31,7 +31,7 @@ #include "main/glheader.h" -#include "util/imports.h" + #include "main/context.h" #include "main/fbobject.h" #include "main/formats.h" @@ -585,7 +585,7 @@ map_attachment(struct gl_context *ctx, assert(srb->Map); } - + static void unmap_attachment(struct gl_context *ctx, @@ -667,8 +667,8 @@ _swrast_map_renderbuffers(struct gl_context *ctx) } } } - - + + /** * Unmap renderbuffers after rendering. */ diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index cd97d0416e5..2eb22539a0f 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -37,7 +37,7 @@ #include "main/format_pack.h" #include "main/format_unpack.h" #include "main/macros.h" -#include "util/imports.h" + #include "main/image.h" #include "main/samplerobj.h" #include "main/state.h" @@ -74,7 +74,7 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan *span) if (ctx->DrawBuffer->Visual.depthBits <= 16) span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F); else { - GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax; + GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax; tmpf = MIN2(tmpf, depthMax); span->z = (GLint)tmpf; } @@ -390,7 +390,7 @@ _swrast_span_interpolate_z( const struct gl_context *ctx, SWspan *span ) if (ctx->DrawBuffer->Visual.depthBits <= 16) { GLfixed zval = span->z; - GLuint *z = span->array->z; + GLuint *z = span->array->z; for (i = 0; i < n; i++) { z[i] = FixedToInt(zval); zval += span->zStep; @@ -1314,7 +1314,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) { const GLuint numBuffers = fb->_NumColorDrawBuffers; const struct gl_program *fp = ctx->FragmentProgram._Current; - const GLboolean multiFragOutputs = + const GLboolean multiFragOutputs = _swrast_use_fragment_program(ctx) && fp->info.outputs_written >= (1 << FRAG_RESULT_DATA0); /* Save srcColorType because convert_color_type() can change it */ diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index 2c59d2e7b3c..5c1118bba69 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -25,7 +25,7 @@ #include "main/glheader.h" #include "main/context.h" -#include "util/imports.h" + #include "main/format_pack.h" #include "main/format_unpack.h" #include "main/stencil.h" @@ -434,9 +434,9 @@ _swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span) put_s8_values(ctx, rb, count, span->array->x, span->array->y, stencilBuf); } - + span->writeAll = GL_FALSE; - + return GL_TRUE; /* one or more fragments passed both tests */ } diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 36574f93610..1ee906effd9 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -26,7 +26,7 @@ #include "main/glheader.h" #include "main/context.h" -#include "util/imports.h" + #include "main/macros.h" #include "main/pixeltransfer.h" #include "main/samplerobj.h" @@ -72,7 +72,7 @@ get_texel_array(SWcontext *swrast, GLuint unit) * \param unit the texture combiner unit * \param primary_rgba incoming fragment color array * \param texelBuffer pointer to texel colors for all texture units - * + * * \param span two fields are used in this function: * span->end: number of fragments to process * span->array->rgba: incoming/result fragment colors diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 5da7f888140..7f1354785a4 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -26,7 +26,7 @@ #include "c99_math.h" #include "main/glheader.h" #include "main/context.h" -#include "util/imports.h" + #include "main/macros.h" #include "main/samplerobj.h" #include "main/teximage.h" @@ -1406,7 +1406,7 @@ sample_linear_2d(struct gl_context *ctx, * Optimized 2-D texture sampling: * S and T wrap mode == GL_REPEAT * GL_NEAREST min/mag filter - * No border, + * No border, * RowStride == Width, * Format = GL_RGB */ @@ -1666,7 +1666,7 @@ sample_2d_ewa(struct gl_context *ctx, GLfloat uy = dudy * scaling; GLfloat vy = dvdy * scaling; - /* compute ellipse coefficients to bound the region: + /* compute ellipse coefficients to bound the region: * A*x*x + B*x*y + C*y*y = F. */ GLfloat A = vx*vx+vy*vy+1; @@ -1847,7 +1847,7 @@ texture_unit_index(const struct gl_context *ctx, } if (u >= maxUnit) u = 0; /* not found, use 1st one; should never happen */ - + return u; } @@ -1871,7 +1871,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx, const struct swrast_texture_image *swImg = swrast_texture_image_const(tImg); const GLfloat maxEccentricity = samp->MaxAnisotropy * samp->MaxAnisotropy; - + /* re-calculate the lambda values so that they are usable with anisotropic * filtering */ @@ -1880,7 +1880,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx, /* based on interpolate_texcoords(struct gl_context *ctx, SWspan *span) * in swrast/s_span.c */ - + /* find the texture unit index by looking up the current texture object * from the context list of available texture objects. */ @@ -1905,7 +1905,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx, || (samp->MinLod != -1000.0F || samp->MaxLod != 1000.0F); GLuint i; - + /* on first access create the lookup table containing the filter weights. */ if (!weightLut) { create_filter_table(); @@ -1916,13 +1916,13 @@ sample_lambda_2d_aniso(struct gl_context *ctx, for (i = 0; i < n; i++) { const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q); - + GLfloat dudx = texW * ((s + dsdx) / (q + dqdx) - s * invQ); GLfloat dvdx = texH * ((t + dtdx) / (q + dqdx) - t * invQ); GLfloat dudy = texW * ((s + dsdy) / (q + dqdy) - s * invQ); GLfloat dvdy = texH * ((t + dtdy) / (q + dqdy) - t * invQ); - - /* note: instead of working with Px and Py, we will use the + + /* note: instead of working with Px and Py, we will use the * squared length instead, to avoid sqrt. */ GLfloat Px2 = dudx * dudx + dvdx * dvdx; @@ -1936,7 +1936,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx, s += dsdx; t += dtdx; q += dqdx; - + if (Px2 < Py2) { Pmax2 = Py2; Pmin2 = Px2; @@ -1945,7 +1945,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx, Pmax2 = Px2; Pmin2 = Py2; } - + /* if the eccentricity of the ellipse is too big, scale up the shorter * of the two vectors to limit the maximum amount of work per pixel */ @@ -1957,12 +1957,12 @@ sample_lambda_2d_aniso(struct gl_context *ctx, Pmin2 *= s; */ Pmin2 = Pmax2 / maxEccentricity; } - + /* note: we need to have Pmin=sqrt(Pmin2) here, but we can avoid * this since 0.5*log(x) = log(sqrt(x)) */ lod = 0.5f * util_fast_log2(Pmin2); - + if (adjustLOD) { /* from swrast/s_texcombine.c _swrast_texture_span */ if (texUnit->LodBias + samp->LodBias != 0.0F) { @@ -1980,7 +1980,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx, } } } - + /* If the ellipse covers the whole image, we can * simply return the average of the whole image. */ @@ -2406,7 +2406,7 @@ choose_cube_face(const struct gl_texture_object *texObj, } } - { + { const float ima = 1.0F / ma; newCoord[0] = ( sc * ima + 1.0F ) * 0.5F; newCoord[1] = ( tc * ima + 1.0F ) * 0.5F; @@ -2917,7 +2917,7 @@ sample_2d_array_linear(struct gl_context *ctx, else { swImg->FetchTexel(swImg, i1, j1, array, t11); } - + /* trilinear interpolation of samples */ lerp_rgba_2d(rgba, a, b, t00, t10, t01, t11); } @@ -3099,7 +3099,7 @@ sample_lambda_2d_array(struct gl_context *ctx, case GL_LINEAR_MIPMAP_LINEAR: sample_2d_array_linear_mipmap_linear(ctx, samp, tObj, m, texcoords + minStart, - lambda + minStart, + lambda + minStart, rgba + minStart); break; default: @@ -3373,7 +3373,7 @@ sample_lambda_1d_array(struct gl_context *ctx, lambda + minStart, rgba + minStart); break; case GL_LINEAR_MIPMAP_NEAREST: - sample_1d_array_linear_mipmap_nearest(ctx, samp, tObj, m, + sample_1d_array_linear_mipmap_nearest(ctx, samp, tObj, m, texcoords + minStart, lambda + minStart, rgba + minStart); @@ -3383,9 +3383,9 @@ sample_lambda_1d_array(struct gl_context *ctx, lambda + minStart, rgba + minStart); break; case GL_LINEAR_MIPMAP_LINEAR: - sample_1d_array_linear_mipmap_linear(ctx, samp, tObj, m, + sample_1d_array_linear_mipmap_linear(ctx, samp, tObj, m, texcoords + minStart, - lambda + minStart, + lambda + minStart, rgba + minStart); break; default: @@ -3579,7 +3579,7 @@ sample_depth_texture( struct gl_context *ctx, nearest_texcoord(samp, tObj, level, texcoords[i], &col, &row, &slice); - if (col >= 0 && row >= 0 && col < width && row < height && + if (col >= 0 && row >= 0 && col < width && row < height && slice >= 0 && slice < depth) { swImg->FetchTexel(swImg, col, row, slice, &depthSample); } diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 7228d2e0e0d..24fddd7718d 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -32,6 +32,7 @@ #include "main/teximage.h" #include "main/texobj.h" #include "util/u_memory.h" +#include "util/u_math.h" #include "swrast/swrast.h" #include "swrast/s_context.h" diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 467439c3fc0..289fa12228b 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -31,7 +31,7 @@ #include "main/glheader.h" #include "main/context.h" -#include "util/imports.h" + #include "main/macros.h" #include "main/mtypes.h" #include "main/state.h" @@ -782,7 +782,7 @@ fast_persp_span(struct gl_context *ctx, SWspan *span, } break; } - + assert(span->arrayMask & SPAN_RGBA); _swrast_write_rgba_span(ctx, span); diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 973e8cfedce..ca4ead9e754 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -25,7 +25,7 @@ #include "main/errors.h" #include "main/glheader.h" #include "main/macros.h" -#include "util/imports.h" + #include "main/format_pack.h" #include "s_context.h" |