summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/prog_execute.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-05-18 14:45:20 -0600
committerBrian Paul <[email protected]>2012-05-19 08:28:57 -0600
commitc9cb9cf0502f4ca179ed1b4dd763c94912843d38 (patch)
treef518f7d395fe4919d8db078c7613a8d0316107af /src/mesa/program/prog_execute.c
parent699c1894eea6a42a747ebbc3974bf0abf3d1dd88 (diff)
mesa: use F_TO_I() instead of IROUND()
Use it where performance matters more and the exact method of float->int conversion/rounding isn't terribly important. There should no net change here since F_TO_I() is the new name of the old IROUND() function. Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/program/prog_execute.c')
-rw-r--r--src/mesa/program/prog_execute.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index 848c2fec105..dd1706e1444 100644
--- a/src/mesa/program/prog_execute.c
+++ b/src/mesa/program/prog_execute.c
@@ -1308,8 +1308,8 @@ _mesa_execute_program(struct gl_context * ctx,
fetch_vector4(&inst->SrcReg[0], machine, a);
a[0] = CLAMP(a[0], 0.0F, 1.0F);
a[1] = CLAMP(a[1], 0.0F, 1.0F);
- usx = IROUND(a[0] * 65535.0F);
- usy = IROUND(a[1] * 65535.0F);
+ usx = F_TO_I(a[0] * 65535.0F);
+ usy = F_TO_I(a[1] * 65535.0F);
result[0] =
result[1] =
result[2] =
@@ -1326,10 +1326,10 @@ _mesa_execute_program(struct gl_context * ctx,
a[1] = CLAMP(a[1], -128.0F / 127.0F, 1.0F);
a[2] = CLAMP(a[2], -128.0F / 127.0F, 1.0F);
a[3] = CLAMP(a[3], -128.0F / 127.0F, 1.0F);
- ubx = IROUND(127.0F * a[0] + 128.0F);
- uby = IROUND(127.0F * a[1] + 128.0F);
- ubz = IROUND(127.0F * a[2] + 128.0F);
- ubw = IROUND(127.0F * a[3] + 128.0F);
+ ubx = F_TO_I(127.0F * a[0] + 128.0F);
+ uby = F_TO_I(127.0F * a[1] + 128.0F);
+ ubz = F_TO_I(127.0F * a[2] + 128.0F);
+ ubw = F_TO_I(127.0F * a[3] + 128.0F);
result[0] =
result[1] =
result[2] =
@@ -1346,10 +1346,10 @@ _mesa_execute_program(struct gl_context * ctx,
a[1] = CLAMP(a[1], 0.0F, 1.0F);
a[2] = CLAMP(a[2], 0.0F, 1.0F);
a[3] = CLAMP(a[3], 0.0F, 1.0F);
- ubx = IROUND(255.0F * a[0]);
- uby = IROUND(255.0F * a[1]);
- ubz = IROUND(255.0F * a[2]);
- ubw = IROUND(255.0F * a[3]);
+ ubx = F_TO_I(255.0F * a[0]);
+ uby = F_TO_I(255.0F * a[1]);
+ ubz = F_TO_I(255.0F * a[2]);
+ ubw = F_TO_I(255.0F * a[3]);
result[0] =
result[1] =
result[2] =