summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_tex_sample.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-08-23 19:28:34 +0100
committerKeith Whitwell <keithw@vmware.com>2009-08-24 08:26:33 +0100
commitfd19e8adcd82e88d0fc8d187360b528100fed244 (patch)
tree2c00d3f5f1739d223aad557fca229b1aa1077def /src/gallium/drivers/softpipe/sp_tex_sample.c
parent60adc15ba5633190fc8a68e7c182f06dc7909df4 (diff)
softpipe: use one fewer divide in sample_cube
GCC won't do this for us. Makes a bigger difference to cubemap fps than previous set of compilcated rearrangements.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_tex_sample.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 3bc4599e04..50460df7cd 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -1543,9 +1543,12 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
}
}
- ssss[j] = ( sc / ma + 1.0F ) * 0.5F;
- tttt[j] = ( tc / ma + 1.0F ) * 0.5F;
- samp->faces[j] = face;
+ {
+ const float ima = 1.0 / ma;
+ ssss[j] = ( sc * ima + 1.0F ) * 0.5F;
+ tttt[j] = ( tc * ima + 1.0F ) * 0.5F;
+ samp->faces[j] = face;
+ }
}
/* In our little pipeline, the compare stage is next. If compare