From 47719fda0c2fba13c81e84e33523d5489263182e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 3 Dec 2004 20:24:50 +0000 Subject: [PATCH] Fix a minor bug in glXEnumFunction::PrintUsingTable. Add some comments. Add the (currently unused) utility funciton glXFunction::opcode_real_value. --- src/mesa/glapi/glX_proto_send.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mesa/glapi/glX_proto_send.py b/src/mesa/glapi/glX_proto_send.py index 452cd7f..c85184d 100644 --- a/src/mesa/glapi/glX_proto_send.py +++ b/src/mesa/glapi/glX_proto_send.py @@ -162,7 +162,7 @@ class glXEnumFunction: masked_enums = {} masked_count = {} - for i in range(0, mask): + for i in range(0, mask + 1): masked_enums[i] = "0"; masked_count[i] = 0; @@ -381,6 +381,15 @@ class glXFunction(gl_XML.glFunction): return "%u%s" % (size, size_string) + def opcode_real_value(self): + if self.glx_vendorpriv != 0: + if self.needs_reply(): + return 17 + else: + return 16 + else: + return self.opcode_value() + def opcode_value(self): if self.glx_rop != 0: return self.glx_rop @@ -691,6 +700,13 @@ generic_%u_byte( GLint rop, const void * ptr ) def printRenderFunction(self, f): + # There is a class of GL functions that take a single pointer + # as a parameter. This pointer points to a fixed-size chunk + # of data, and the protocol for this functions is very + # regular. Since they are so regular and there are so many + # of them, special case them with generic functions. On + # x86, this save about 26KB in the libGL.so binary. + if f.variable_length_parameter() == None and len(f.fn_parameters) == 1: p = f.fn_parameters[0] if p.is_pointer: -- 2.7.4