diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2011-03-02 12:20:45 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2011-03-02 12:20:45 -0500 |
commit | 6835e22256ba7a74c02504383f63baaba7e87156 (patch) | |
tree | 3377d7ed2d1be127513f5203abcafc57f48f76ac | |
parent | 8a8862e4165dc5be779bce5e327a31da4826db3b (diff) |
r6xx+: truncate point sampled coordinates
By default the hardware rounds texcoords. However,
for point sampled textures, the expected behavior is
to truncate. When we have point sampled textures,
set the truncate bit in the sampler.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
-rw-r--r-- | src/evergreen_exa.c | 2 | ||||
-rw-r--r-- | src/r600_exa.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c index e5e75593..553f05e2 100644 --- a/src/evergreen_exa.c +++ b/src/evergreen_exa.c @@ -325,6 +325,7 @@ EVERGREENDoPrepareCopy(ScrnInfoPtr pScrn) tex_samp.clamp_z = SQ_TEX_WRAP; tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_POINT; tex_samp.xy_min_filter = SQ_TEX_XY_FILTER_POINT; + tex_samp.mc_coord_truncate = 1; tex_samp.z_filter = SQ_TEX_Z_FILTER_NONE; tex_samp.mip_filter = 0; /* no mipmap */ evergreen_set_tex_sampler (pScrn, &tex_samp); @@ -973,6 +974,7 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix, case PictFilterNearest: tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_POINT; tex_samp.xy_min_filter = SQ_TEX_XY_FILTER_POINT; + tex_samp.mc_coord_truncate = 1; break; case PictFilterBilinear: tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_BILINEAR; diff --git a/src/r600_exa.c b/src/r600_exa.c index ab5e33b7..57e5c0f9 100644 --- a/src/r600_exa.c +++ b/src/r600_exa.c @@ -467,6 +467,7 @@ R600DoPrepareCopy(ScrnInfoPtr pScrn) tex_samp.clamp_z = SQ_TEX_WRAP; tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_POINT; tex_samp.xy_min_filter = SQ_TEX_XY_FILTER_POINT; + tex_samp.mc_coord_truncate = 1; tex_samp.z_filter = SQ_TEX_Z_FILTER_NONE; tex_samp.mip_filter = 0; /* no mipmap */ r600_set_tex_sampler(pScrn, accel_state->ib, &tex_samp); @@ -1115,6 +1116,7 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix, case PictFilterNearest: tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_POINT; tex_samp.xy_min_filter = SQ_TEX_XY_FILTER_POINT; + tex_samp.mc_coord_truncate = 1; break; case PictFilterBilinear: tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_BILINEAR; |