mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
mesa: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
This commit is contained in:
parent
0f1fde1faf
commit
05bacdb917
7 changed files with 13 additions and 13 deletions
|
|
@ -3356,7 +3356,7 @@ _mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -154,8 +154,8 @@ _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -5338,7 +5338,7 @@ sample_locations(struct gl_context *ctx, struct gl_framebuffer *fb,
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ _mesa_SampleCoverage(GLclampf value, GLboolean invert)
|
|||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
value = CLAMP(value, 0.0f, 1.0f);
|
||||
value = SATURATE(value);
|
||||
|
||||
if (ctx->Multisample.SampleCoverageInvert == invert &&
|
||||
ctx->Multisample.SampleCoverageValue == value)
|
||||
|
|
@ -165,7 +165,7 @@ _mesa_SampleMaski(GLuint index, GLbitfield mask)
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -295,8 +295,8 @@ set_depth_range_no_notify(struct gl_context *ctx, unsigned idx,
|
|||
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
|
||||
|
|
|
|||
|
|
@ -440,10 +440,10 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
|
|||
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]);
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
|
|||
return;
|
||||
}
|
||||
|
||||
z = CLAMP(z, 0.0f, 1.0f);
|
||||
z = SATURATE(z);
|
||||
|
||||
/* positions (in clip coords) */
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue