X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsoftpipe%2Fsp_tex_sample.h;h=96fab8e338790f20f6c67bb5377201571cf76a0c;hb=1c8bcad81a7ce106b37f1ee4a75b817651d6545e;hp=cee545d545a2df887baddceb4d7e62d236b7a51c;hpb=b9bc6c42c96773a5784897c55da5387045c0e9b3;p=mesa.git diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.h b/src/gallium/drivers/softpipe/sp_tex_sample.h index cee545d545a..96fab8e3387 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.h +++ b/src/gallium/drivers/softpipe/sp_tex_sample.h @@ -53,6 +53,10 @@ typedef float (*compute_lambda_func)(const struct sp_sampler_view *sp_sview, const float t[TGSI_QUAD_SIZE], const float p[TGSI_QUAD_SIZE]); +typedef float (*compute_lambda_from_grad_func)(const struct sp_sampler_view *sp_sview, + const float derivs[3][2][TGSI_QUAD_SIZE], + uint quad); + struct img_filter_args { float s; float t; @@ -64,39 +68,34 @@ struct img_filter_args { int gather_comp; }; -typedef void (*img_filter_func)(struct sp_sampler_view *sp_sview, - struct sp_sampler *sp_samp, +typedef void (*img_filter_func)(const struct sp_sampler_view *sp_sview, + const struct sp_sampler *sp_samp, const struct img_filter_args *args, float *rgba); struct filter_args { enum tgsi_sampler_control control; const int8_t *offset; + const uint *faces; }; -typedef void (*mip_filter_func)(struct sp_sampler_view *sp_sview, - struct sp_sampler *sp_samp, +typedef void (*mip_filter_func)(const struct sp_sampler_view *sp_sview, + const struct sp_sampler *sp_samp, img_filter_func min_filter, img_filter_func mag_filter, const float s[TGSI_QUAD_SIZE], const float t[TGSI_QUAD_SIZE], const float p[TGSI_QUAD_SIZE], - const float c0[TGSI_QUAD_SIZE], + int gather_comp, const float lod[TGSI_QUAD_SIZE], 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 (*mip_level_func)(const struct sp_sampler_view *sp_sview, + const struct sp_sampler *sp_samp, + const float lod[TGSI_QUAD_SIZE], + float level[TGSI_QUAD_SIZE]); typedef void (*fetch_func)(struct sp_sampler_view *sp_sview, const int i[TGSI_QUAD_SIZE], @@ -116,19 +115,17 @@ struct sp_sampler_view boolean need_swizzle; boolean pot2d; - - filter_func get_samples; - - /* this is just abusing the sampler_view object as local storage */ - unsigned faces[TGSI_QUAD_SIZE]; + boolean need_cube_convert; /* these are different per shader type */ struct softpipe_tex_tile_cache *cache; compute_lambda_func compute_lambda; - + compute_lambda_from_grad_func compute_lambda_from_grad; + union pipe_color_union border_color; }; struct sp_filter_funcs { + mip_level_func relative_level; mip_filter_func filter; }; @@ -163,8 +160,12 @@ struct sp_tgsi_sampler }; compute_lambda_func -softpipe_get_lambda_func(const struct pipe_sampler_view *view, unsigned shader); +softpipe_get_lambda_func(const struct pipe_sampler_view *view, + enum pipe_shader_type shader); +compute_lambda_from_grad_func +softpipe_get_lambda_from_grad_func(const struct pipe_sampler_view *view, + enum pipe_shader_type shader); void * softpipe_create_sampler_state(struct pipe_context *pipe,