diff options
author | marha <marha@users.sourceforge.net> | 2011-04-10 18:53:44 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-10 18:53:44 +0000 |
commit | 57fb3f76b66c5f7a9f7bed9c42fb9fec9d56ee05 (patch) | |
tree | 62c44b8772f885ab8252004587bcf01b1c2741ba /mesalib/src/mesa/state_tracker/st_atom_sampler.c | |
parent | 5deaba2736a906e599eb03f2883fba036150c662 (diff) | |
parent | 2fb58f16eeec8ef3ec2a25e246477aab64e38a7d (diff) | |
download | vcxsrv-57fb3f76b66c5f7a9f7bed9c42fb9fec9d56ee05.tar.gz vcxsrv-57fb3f76b66c5f7a9f7bed9c42fb9fec9d56ee05.tar.bz2 vcxsrv-57fb3f76b66c5f7a9f7bed9c42fb9fec9d56ee05.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_sampler.c')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom_sampler.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_sampler.c b/mesalib/src/mesa/state_tracker/st_atom_sampler.c index d1ab1ac3e..48b94500d 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_sampler.c +++ b/mesalib/src/mesa/state_tracker/st_atom_sampler.c @@ -166,12 +166,11 @@ update_samplers(struct st_context *st) sampler->lod_bias = st->ctx->Texture.Unit[texUnit].LodBias +
texobj->LodBias;
- sampler->min_lod = texobj->BaseLevel + texobj->MinLod;
- if (sampler->min_lod < texobj->BaseLevel)
- sampler->min_lod = texobj->BaseLevel;
-
- sampler->max_lod = MIN2((GLfloat) texobj->MaxLevel,
- (texobj->MaxLod + texobj->BaseLevel));
+ sampler->min_lod = CLAMP(texobj->MinLod,
+ 0.0f,
+ (GLfloat) texobj->MaxLevel - texobj->BaseLevel);
+ sampler->max_lod = MIN2((GLfloat) texobj->MaxLevel - texobj->BaseLevel,
+ texobj->MaxLod);
if (sampler->max_lod < sampler->min_lod) {
/* The GL spec doesn't seem to specify what to do in this case.
* Swap the values.
|