const GLfloat x1 = x + width;
const GLfloat y1 = y + height;
- z = CLAMP(z, 0.0f, 1.0f);
+ z = SATURATE(z);
z = invert_z(z);
verts[0].x = x;
return;
}
- zmin = CLAMP(zmin, 0.0, 1.0);
- zmax = CLAMP(zmax, 0.0, 1.0);
+ zmin = SATURATE(zmin);
+ zmax = SATURATE(zmax);
if (ctx->Depth.BoundsMin == zmin && ctx->Depth.BoundsMax == zmax)
return;
if (isnan(v[i]))
fb->SampleLocationTable[start * 2 + i] = 0.5f;
else
- fb->SampleLocationTable[start * 2 + i] = CLAMP(v[i], 0.0f, 1.0f);
+ fb->SampleLocationTable[start * 2 + i] = SATURATE(v[i]);
}
if (fb == ctx->DrawBuffer)
{
GET_CURRENT_CONTEXT(ctx);
- value = CLAMP(value, 0.0f, 1.0f);
+ value = SATURATE(value);
if (ctx->Multisample.SampleCoverageInvert == invert &&
ctx->Multisample.SampleCoverageValue == value)
static void
min_sample_shading(struct gl_context *ctx, GLclampf value)
{
- value = CLAMP(value, 0.0f, 1.0f);
+ value = SATURATE(value);
if (ctx->Multisample.MinSampleShadingValue == value)
return;
FLUSH_VERTICES(ctx, _NEW_VIEWPORT);
ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
- ctx->ViewportArray[idx].Near = CLAMP(nearval, 0.0, 1.0);
- ctx->ViewportArray[idx].Far = CLAMP(farval, 0.0, 1.0);
+ ctx->ViewportArray[idx].Near = SATURATE(nearval);
+ ctx->ViewportArray[idx].Far = SATURATE(farval);
}
void
if(ctx->Light._ClampVertexColor &&
(idx == VERT_ATTRIB_COLOR0 ||
idx == VERT_ATTRIB_COLOR1)) {
- value[0] = CLAMP(ctx->Current.Attrib[idx][0], 0.0f, 1.0f);
- value[1] = CLAMP(ctx->Current.Attrib[idx][1], 0.0f, 1.0f);
- value[2] = CLAMP(ctx->Current.Attrib[idx][2], 0.0f, 1.0f);
- value[3] = CLAMP(ctx->Current.Attrib[idx][3], 0.0f, 1.0f);
+ value[0] = SATURATE(ctx->Current.Attrib[idx][0]);
+ value[1] = SATURATE(ctx->Current.Attrib[idx][1]);
+ value[2] = SATURATE(ctx->Current.Attrib[idx][2]);
+ value[3] = SATURATE(ctx->Current.Attrib[idx][3]);
}
else
COPY_4V(value, ctx->Current.Attrib[idx]);
return;
}
- z = CLAMP(z, 0.0f, 1.0f);
+ z = SATURATE(z);
/* positions (in clip coords) */
{