summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-18 10:05:25 -0700
committerBrian Paul <[email protected]>2012-01-18 10:44:05 -0700
commit5abcd198b8e644c0d97c6766c6707e20fe22f0fb (patch)
treef14ba1baf02891af6dbd7ec2542cf38da1a93c70 /src/gallium/drivers/svga
parent84c7c14697c82fe25586f8186b4f47d80a6f05f9 (diff)
svga: add 0.5 in float->int conversion of sample min/max lod
This makes lod clamping more consistent with other drivers. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_sampler.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c
index 4885d200584..13c7b181b7c 100644
--- a/src/gallium/drivers/svga/svga_pipe_sampler.c
+++ b/src/gallium/drivers/svga/svga_pipe_sampler.c
@@ -125,8 +125,8 @@ svga_create_sampler_state(struct pipe_context *pipe,
* - min/max LOD clamping
*/
cso->min_lod = 0;
- cso->view_min_lod = MAX2(sampler->min_lod, 0);
- cso->view_max_lod = MAX2(sampler->max_lod, 0);
+ cso->view_min_lod = MAX2((int) (sampler->min_lod + 0.5), 0);
+ cso->view_max_lod = MAX2((int) (sampler->max_lod + 0.5), 0);
/* Use min_mipmap */
if (svga->debug.use_min_mipmap) {