diff options
author | Matt Turner <mattst88@gmail.com> | 2015-07-12 00:13:45 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2015-07-29 09:34:51 -0700 |
commit | c1da15709a0c0c2775bd9e534f67c60f7dc95ce8 (patch) | |
tree | 67fa5a5d7ad58315d8ca012239f5a83e74fd668d /src/mesa/drivers/dri/i965/brw_sf_state.c | |
parent | c67ce2bd3b27a26d7f5665f296d307c0de39b720 (diff) | |
download | external_mesa3d-c1da15709a0c0c2775bd9e534f67c60f7dc95ce8.zip external_mesa3d-c1da15709a0c0c2775bd9e534f67c60f7dc95ce8.tar.gz external_mesa3d-c1da15709a0c0c2775bd9e534f67c60f7dc95ce8.tar.bz2 |
i965: Use float calculations when double is unnecessary.
Literals without an f/F suffix are of type double, and implicit
conversion rules specify that the float in (float op double) be
converted to a double before the operation is performed. I believe float
execution was intended (in nearly all cases) or is sufficient (in the
case of gen7_urb.c).
Removes a lot of float <-> double conversion instructions and replaces
many double instructions with float instructions which are cheaper.
text data bss dec hex filename
4928659 195160 26192 5150011 4e953b i965_dri.so before
4928315 195152 26192 5149659 4e93db i965_dri.so after
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_sf_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_sf_state.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index 3be6e4a..b126f82 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -220,7 +220,7 @@ static void upload_sf_unit( struct brw_context *brw ) /* _NEW_LINE */ sf->sf6.line_width = - CLAMP(ctx->Line.Width, 1.0, ctx->Const.MaxLineWidth) * (1<<1); + CLAMP(ctx->Line.Width, 1.0f, ctx->Const.MaxLineWidth) * (1<<1); sf->sf6.line_endcap_aa_region_width = 1; if (ctx->Line.SmoothFlag) @@ -259,9 +259,10 @@ static void upload_sf_unit( struct brw_context *brw ) /* _NEW_POINT */ sf->sf7.sprite_point = ctx->Point.PointSprite; - sf->sf7.point_size = CLAMP(rint(CLAMP(ctx->Point.Size, - ctx->Point.MinSize, - ctx->Point.MaxSize)), 1, 255) * (1<<3); + sf->sf7.point_size = CLAMP(rintf(CLAMP(ctx->Point.Size, + ctx->Point.MinSize, + ctx->Point.MaxSize)), 1.0f, 255.0f) * + (1<<3); /* _NEW_PROGRAM | _NEW_POINT */ sf->sf7.use_point_size_state = !(ctx->VertexProgram.PointSizeEnabled || ctx->Point._Attenuated); |