From eecdbaa98578110523b04b8a4f160b8df2dea82f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Oct 2017 12:29:39 -0700 Subject: broadcom/vc5: Add PIPE_TEX_WRAP_CLAMP support for linear-filtered textures. I already had the texture's wrapping set up to use different behavior for nearest or linear, so we just needed to saturate the coordinates in linear mode to get the "proper" blend between the edge and border values. --- src/gallium/drivers/vc5/vc5_program.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/vc5/vc5_program.c') diff --git a/src/gallium/drivers/vc5/vc5_program.c b/src/gallium/drivers/vc5/vc5_program.c index 8e9af1ad8ab..37173ae58d5 100644 --- a/src/gallium/drivers/vc5/vc5_program.c +++ b/src/gallium/drivers/vc5/vc5_program.c @@ -304,8 +304,12 @@ vc5_setup_shared_key(struct vc5_context *vc5, struct v3d_key *key, } else if (sampler){ key->tex[i].compare_mode = sampler_state->compare_mode; key->tex[i].compare_func = sampler_state->compare_func; - key->tex[i].wrap_s = sampler_state->wrap_s; - key->tex[i].wrap_t = sampler_state->wrap_t; + key->tex[i].clamp_s = + sampler_state->wrap_s == PIPE_TEX_WRAP_CLAMP; + key->tex[i].clamp_t = + sampler_state->wrap_t == PIPE_TEX_WRAP_CLAMP; + key->tex[i].clamp_r = + sampler_state->wrap_r == PIPE_TEX_WRAP_CLAMP; } } -- cgit v1.2.3