diff options
author | Eric Anholt <[email protected]> | 2017-10-24 12:29:39 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-10-30 13:31:16 -0700 |
commit | eecdbaa98578110523b04b8a4f160b8df2dea82f (patch) | |
tree | c4f4d57912314d50450b72a1b16ff643b0994609 /src/gallium | |
parent | e798455330d15d7c99b5ebe36f7de0793aae39b5 (diff) |
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.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/vc5/vc5_program.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; } } |