From 6835e22256ba7a74c02504383f63baaba7e87156 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 2 Mar 2011 12:20:45 -0500 Subject: 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 --- src/evergreen_exa.c | 2 ++ src/r600_exa.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c index e5e7559..553f05e 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 ab5e33b..57e5c0f 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; -- cgit v1.2.3