diff options
author | Ian Romanick <idr@us.ibm.com> | 2005-02-02 00:54:45 +0000 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2005-02-02 00:54:45 +0000 |
commit | 3fec8c24ec14a5e07953828beba7e03d6367ae34 (patch) | |
tree | 78c75edd264ddfa0d6225348af8faa9e5872400b /src/mesa/glapi/glX_proto_send.py | |
parent | 6b158a7d23b8d2c290589a53d604f2e50d435922 (diff) |
Small refactor. Add glXFunctionIterator, which derrives from
glFunctionIterator and is used by GlxProto. The difference between the two
iterator classes is that glXFunctionIterator skips functions that the GLX
protocol code does not care about.
Replace all the remaining occurances of glParameter::p_count_parameters and
glFunction::count_parameters with the count_parameter_list.
Add GlxProto::size_call to generate the C code to calculate 'compsize'.
These trivially modify the generated code.
Diffstat (limited to 'src/mesa/glapi/glX_proto_send.py')
-rw-r--r-- | src/mesa/glapi/glX_proto_send.py | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/mesa/glapi/glX_proto_send.py b/src/mesa/glapi/glX_proto_send.py index 949a0c9433..6ee93a5c1e 100644 --- a/src/mesa/glapi/glX_proto_send.py +++ b/src/mesa/glapi/glX_proto_send.py @@ -101,7 +101,7 @@ class glXPixelFunctionUtility(glX_XML.glXFunction): self.set_return_type( func.fn_return_type ) self.glx_rop = ~0 self.can_be_large = func.can_be_large - self.count_parameters = func.count_parameters + self.count_parameter_list = func.count_parameter_list self.counter = func.counter return @@ -218,7 +218,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; return def printFunction(self, f): - if f.fn_offset < 0 or f.client_handcode or f.ignore: return + if f.client_handcode: return if f.glx_rop != 0 or f.vectorequiv != None: if f.image: @@ -339,17 +339,10 @@ generic_%u_byte( GLint rop, const void * ptr ) if f.fn_return_type != 'void': print ' %s retval = (%s) 0;' % (f.fn_return_type, f.fn_return_type) - if f.count_parameters and not f.output_parameter(): - print ' const GLuint compsize = __gl%s_size(%s);' % (f.name, f.count_parameters) - elif f.image: - [dim, w, h, d, junk] = f.dimensions() - - compsize = '__glImageSize(%s, %s, %s, %s, %s, %s)' % (w, h, d, f.image.img_format, f.image.img_type, f.image.img_target) - if not f.image.img_send_null: - compsize = '(%s != NULL) ? %s : 0' % (f.image.name, compsize) - - print ' const GLuint compsize = %s;' % (compsize) - + if not f.output_parameter(): + compsize = self.size_call( f ) + if compsize: + print ' const GLuint compsize = %s;' % (compsize) print ' const GLuint cmdlen = %s;' % (f.command_length()) @@ -740,8 +733,6 @@ __GLapi * __glXNewIndirectAPI( void ) """ def printFunction(self, f): - if f.fn_offset < 0 or f.ignore: return - if f.category != self.last_category: self.last_category = f.category print '' @@ -773,7 +764,6 @@ class PrintGlxProtoInit_h(glX_XML.GlxProto): def printFunction(self, f): - if f.fn_offset < 0 or f.ignore: return print 'extern HIDDEN %s __indirect_gl%s(%s);' % (f.fn_return_type, f.name, f.get_parameter_string()) |