X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fsampler.cpp;h=7560029c64642cdef978b147c9d2be5e4263bafe;hb=4365124bd39bd6edbda6eaef64ec72a1a10565f8;hp=6658ef9ac75d05a8b1016a84afb6847404b196d7;hpb=0a359a7508a0117b055b72bcb7dc42ddcb2ed5f9;p=libs%2Fgl.git diff --git a/source/core/sampler.cpp b/source/core/sampler.cpp index 6658ef9a..7560029c 100644 --- a/source/core/sampler.cpp +++ b/source/core/sampler.cpp @@ -1,4 +1,5 @@ #include +#include "deviceinfo.h" #include "error.h" #include "sampler.h" @@ -21,6 +22,8 @@ void Sampler::set_min_filter(TextureFilter f) void Sampler::set_mag_filter(TextureFilter f) { + if(is_mipmapped(f)) + throw invalid_argument("Sampler::set_mag_filter"); mag_filter = f; dirty_params |= MAG_FILTER; } @@ -35,6 +38,8 @@ void Sampler::set_max_anisotropy(float a) { if(a<1.0f) throw invalid_argument("Sampler::set_max_anisotropy"); + if(a>DeviceInfo::get_global().limits.max_anisotropy) + throw out_of_range("Sampler::set_max_anisotropy"); bool supported = check_anisotropic(a>1.0f); max_anisotropy = a; if(supported)