diff options
author | Neha Bhende <[email protected]> | 2017-07-20 13:59:36 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-07-22 13:18:56 -0600 |
commit | acfb1583a560339b500a94bc13bf73675e7ed422 (patch) | |
tree | 3e7cd84f3b0162a54efcd2e2fb03845474943fb0 /src/gallium/drivers/svga/svga_shader.c | |
parent | dc62ddfb39e2287f1376df94e15bf108a73f12b0 (diff) |
svga: fix unnormalized->normalized texture coordinate conversion
Sometimes, converting unnormalized coordinates to normalized
coordinates requires an epsilon value to produce the right texels with
nearest filtering. Adding 0.0001 to the coordinates when the min/mag
filter is nearest fixes the issue.
Fixes piglit test fbo-blit-scaled-linear
Tested with mtt-piglit, mtt-glretrace
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_shader.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_shader.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_shader.c b/src/gallium/drivers/svga/svga_shader.c index 74c829eefc1..9e2b65771cd 100644 --- a/src/gallium/drivers/svga/svga_shader.c +++ b/src/gallium/drivers/svga/svga_shader.c @@ -246,6 +246,11 @@ svga_init_shader_key_common(const struct svga_context *svga, key->tex[i].width_height_idx = idx++; key->tex[i].unnormalized = TRUE; ++key->num_unnormalized_coords; + + if (sampler->magfilter == SVGA3D_TEX_FILTER_NEAREST || + sampler->minfilter == SVGA3D_TEX_FILTER_NEAREST) { + key->tex[i].texel_bias = TRUE; + } } } } |