diff options
author | Krzesimir Nowak <[email protected]> | 2015-09-10 14:15:56 +0200 |
---|---|---|
committer | Brian Paul <[email protected]> | 2015-09-10 09:45:14 -0600 |
commit | ac3637dda04fe1315f19099bd142e4f8f6754b1d (patch) | |
tree | fe8762745c2eecea52b3477b4a585e75096843c5 /src/gallium/drivers/softpipe/sp_tex_sample.h | |
parent | 380a3c08049e5a3b0b1a891e3288b001c535d62f (diff) |
softpipe: Split 3D to 2D coords conversion into separate function
This is to avoid tying the conversion to the sampling -
textureQueryLod will need to do the conversion too, but it does not do
any sampling.
So instead of a "get_samples" vfunc, there is just a bool saying
whether the conversion is needed or not. This solution keeps a nice
property of not adding any overhead for the common case (2D textures).
v2:
- replaced the "convert_coords" vfunc with a "need_cube_convert"
boolean to avoid overhead of copying arrays in common case
- removed an unused typedef
- splitted too long lines in convert_cube
- const fixes in convert_cube
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_tex_sample.h')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_tex_sample.h | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.h b/src/gallium/drivers/softpipe/sp_tex_sample.h index cee545d545a..2e3976d8034 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.h +++ b/src/gallium/drivers/softpipe/sp_tex_sample.h @@ -86,18 +86,6 @@ typedef void (*mip_filter_func)(struct sp_sampler_view *sp_sview, const struct filter_args *args, float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE]); - -typedef void (*filter_func)(struct sp_sampler_view *sp_sview, - struct sp_sampler *sp_samp, - const float s[TGSI_QUAD_SIZE], - const float t[TGSI_QUAD_SIZE], - const float p[TGSI_QUAD_SIZE], - const float c0[TGSI_QUAD_SIZE], - const float lod[TGSI_QUAD_SIZE], - const struct filter_args *args, - float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE]); - - typedef void (*fetch_func)(struct sp_sampler_view *sp_sview, const int i[TGSI_QUAD_SIZE], const int j[TGSI_QUAD_SIZE], const int k[TGSI_QUAD_SIZE], @@ -116,8 +104,7 @@ struct sp_sampler_view boolean need_swizzle; boolean pot2d; - - filter_func get_samples; + boolean need_cube_convert; /* this is just abusing the sampler_view object as local storage */ unsigned faces[TGSI_QUAD_SIZE]; |