diff options
author | marha <marha@users.sourceforge.net> | 2011-04-10 18:43:19 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-10 18:43:19 +0000 |
commit | 2fb58f16eeec8ef3ec2a25e246477aab64e38a7d (patch) | |
tree | a4dbbe4f2c9a6524e99452ab43c972d5dbfa015f /mesalib/src/mesa/state_tracker/st_atom_sampler.c | |
parent | de1c6801fc854692d39fb2f8d53bf54ab25a1287 (diff) | |
download | vcxsrv-2fb58f16eeec8ef3ec2a25e246477aab64e38a7d.tar.gz vcxsrv-2fb58f16eeec8ef3ec2a25e246477aab64e38a7d.tar.bz2 vcxsrv-2fb58f16eeec8ef3ec2a25e246477aab64e38a7d.zip |
mesa git update
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.
|