From: José Fonseca Date: Mon, 9 May 2011 10:32:15 +0000 (+0100) Subject: Don't try to use more samples than the implementation supports X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=42926463db50d889b4b49497169a5e186c394a5d;p=apitrace Don't try to use more samples than the implementation supports --- diff --git a/glretrace.py b/glretrace.py index 60cbb24..d306754 100644 --- a/glretrace.py +++ b/glretrace.py @@ -178,6 +178,15 @@ class GlRetracer(Retracer): Retracer.extract_arg(self, function, arg, arg_type, lvalue, rvalue) + # Don't try to use more samples than the implementation supports + if arg.name == 'samples': + assert arg.type is glapi.GLsizei + print ' GLint max_samples = 0;' + print ' glGetIntegerv(GL_MAX_SAMPLES, &max_samples);' + print ' if (samples > max_samples) {' + print ' samples = max_samples;' + print ' }' + if __name__ == '__main__': print r'''