From 42926463db50d889b4b49497169a5e186c394a5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 9 May 2011 11:32:15 +0100 Subject: [PATCH] Don't try to use more samples than the implementation supports --- glretrace.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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''' -- 2.45.2