This only adds corde that is not yet enabled.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
if (sp_sviewsrc) {
memcpy(sp_sviewdst, sp_sviewsrc, sizeof(*sp_sviewsrc));
sp_sviewdst->compute_lambda = softpipe_get_lambda_func(&sp_sviewdst->base, shader);
+ sp_sviewdst->compute_lambda_from_grad = softpipe_get_lambda_from_grad_func(&sp_sviewdst->base, shader);
sp_sviewdst->cache = softpipe->tex_cache[shader][start + i];
}
else {
}
+static float
+compute_lambda_vert_explicite_gradients(UNUSED const struct sp_sampler_view *sview,
+ UNUSED const float derivs[3][2][TGSI_QUAD_SIZE],
+ UNUSED int quad)
+{
+ return 0.0f;
+}
+
+
+compute_lambda_from_grad_func
+softpipe_get_lambda_from_grad_func(const struct pipe_sampler_view *view,
+ enum pipe_shader_type shader)
+{
+ switch (view->target) {
+ case PIPE_BUFFER:
+ case PIPE_TEXTURE_1D:
+ case PIPE_TEXTURE_1D_ARRAY:
+ return compute_lambda_1d_explicit_gradients;
+ case PIPE_TEXTURE_2D:
+ case PIPE_TEXTURE_2D_ARRAY:
+ case PIPE_TEXTURE_RECT:
+ return compute_lambda_2d_explicit_gradients;
+ case PIPE_TEXTURE_CUBE:
+ case PIPE_TEXTURE_CUBE_ARRAY:
+ return compute_lambda_cube_explicit_gradients;
+ case PIPE_TEXTURE_3D:
+ return compute_lambda_3d_explicit_gradients;
+ default:
+ assert(0);
+ return compute_lambda_1d_explicit_gradients;
+ }
+}
+
/**
* Get a texel from a texture, using the texture tile cache.
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;
/* 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;
};
struct sp_filter_funcs {
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,