aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzesimir Nowak <[email protected]>2015-09-12 08:17:00 -0600
committerBrian Paul <[email protected]>2015-09-13 09:50:21 -0600
commit08ceb5e076328bf6ccceed3a8e5de205dcaf63b0 (patch)
treee056eac5e7a933440089578aedceab09d802329b
parent59519c2283e91ce4b8c2028673d6d8dc4ee5138f (diff)
softpipe: Change faces type to uint
This is to avoid needless float<->int conversions, since all face-related computations are made on integers. Spotted by Emil Velikov. Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c10
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index dfe38af5354..8a0935062b6 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -2200,7 +2200,7 @@ img_filter_2d_ewa(const struct sp_sampler_view *sp_sview,
const float s[TGSI_QUAD_SIZE],
const float t[TGSI_QUAD_SIZE],
const float p[TGSI_QUAD_SIZE],
- const float faces[TGSI_QUAD_SIZE],
+ const uint faces[TGSI_QUAD_SIZE],
unsigned level,
const float dudx, const float dvdx,
const float dudy, const float dvdy,
@@ -3089,7 +3089,7 @@ convert_cube(const struct sp_sampler_view *sp_sview,
float ssss[TGSI_QUAD_SIZE],
float tttt[TGSI_QUAD_SIZE],
float pppp[TGSI_QUAD_SIZE],
- float faces[TGSI_QUAD_SIZE])
+ uint faces[TGSI_QUAD_SIZE])
{
unsigned j;
@@ -3564,14 +3564,14 @@ sp_tgsi_get_samples(struct tgsi_sampler *tgsi_sampler,
float cs[TGSI_QUAD_SIZE];
float ct[TGSI_QUAD_SIZE];
float cp[TGSI_QUAD_SIZE];
- float faces[TGSI_QUAD_SIZE];
+ uint faces[TGSI_QUAD_SIZE];
convert_cube(sp_sview, sp_samp, s, t, p, c0, cs, ct, cp, faces);
filt_args.faces = faces;
sample_mip(sp_sview, sp_samp, cs, ct, cp, c0, lod, &filt_args, rgba);
} else {
- static const float zero_faces[TGSI_QUAD_SIZE] = {0.0f, 0.0f, 0.0f, 0.0f};
+ static const uint zero_faces[TGSI_QUAD_SIZE] = {0, 0, 0, 0};
filt_args.faces = zero_faces;
sample_mip(sp_sview, sp_samp, s, t, p, c0, lod, &filt_args, rgba);
@@ -3619,7 +3619,7 @@ sp_tgsi_query_lod(const struct tgsi_sampler *tgsi_sampler,
float cs[TGSI_QUAD_SIZE];
float ct[TGSI_QUAD_SIZE];
float cp[TGSI_QUAD_SIZE];
- float unused_faces[TGSI_QUAD_SIZE];
+ uint unused_faces[TGSI_QUAD_SIZE];
convert_cube(sp_sview, sp_samp, s, t, p, c0, cs, ct, cp, unused_faces);
compute_lambda_lod_unclamped(sp_sview, sp_samp,
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.h b/src/gallium/drivers/softpipe/sp_tex_sample.h
index 83ee3a33839..d591487d1b4 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.h
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.h
@@ -72,7 +72,7 @@ typedef void (*img_filter_func)(const struct sp_sampler_view *sp_sview,
struct filter_args {
enum tgsi_sampler_control control;
const int8_t *offset;
- const float *faces;
+ const uint *faces;
};
typedef void (*mip_filter_func)(const struct sp_sampler_view *sp_sview,