mesa/st: remove redundant call to st_finish in CopyTexSubImage
[mesa.git] / src / mesa / glapi / glX_proto_size.py
index ad9f44ecf1d97e50b73caa8f4e4428fcbc528019..95cb5110cc3cc8d7dd08619883a90ddd33d15432 100644 (file)
@@ -277,7 +277,7 @@ class glx_server_enum_function(glx_enum_function):
                for o in keys:
                        p = f.parameters_by_name[ foo[o] ]
 
-                       printer.common_emit_one_arg(p, "pc", "    ", 0)
+                       printer.common_emit_one_arg(p, "pc", 0)
                        fixup.append( p.name )
 
 
@@ -316,6 +316,8 @@ class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common):
                print '#include <GL/gl.h>'
                if self.emit_get:
                        print '#include "indirect_size_get.h"'
+                       print '#include "glxserver.h"'
+                       print '#include "indirect_util.h"'
                
                print '#include "indirect_size.h"'
 
@@ -445,17 +447,9 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
                print ''
                print '#include <GL/gl.h>'
                print '#include "glxserver.h"'
+               print '#include "glxbyteorder.h"'
                print '#include "indirect_size.h"'
                print '#include "indirect_reqsize.h"'
-               print ''
-               print '#if defined(linux)'
-               print '#  include <byteswap.h>'
-               print '#  define SWAP_32(v)  do { (v) = bswap_32(v)); } while(0)'
-               print '#else'
-               print '#  include <X11/misc.h>'
-               print '#  define SWAP_32(v)  do { char tmp; swapl(&v, tmp); } while(0)'
-               print '#endif'
-               
                print ''
                print '#define __GLX_PAD(x)  (((x) + 3) & ~3)'
                print ''
@@ -536,17 +530,17 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
                if fixup:
                        print '    if (swap) {'
                        for name in fixup:
-                               print '        SWAP_32( %s );' % (name)
+                               print '        %s = bswap_32(%s);' % (name, name)
                        print '    }'
 
                return
 
 
-       def common_emit_one_arg(self, p, pc, indent, adjust):
+       def common_emit_one_arg(self, p, pc, adjust):
                offset = p.offset
                dst = p.string()
                src = '(%s *)' % (p.type_string())
-               print '%s%-18s = *%11s(%s + %u);' % (indent, dst, src, pc, offset + adjust);
+               print '%-18s = *%11s(%s + %u);' % (dst, src, pc, offset + adjust);
                return
 
 
@@ -580,13 +574,18 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
                img = f.images[0]
                for p in f.parameterIterateGlxSend():
                        if p.name in [w, h, d, img.img_format, img.img_type, img.img_target]:
-                               self.common_emit_one_arg( p, "pc", "    ", 0 )
+                               self.common_emit_one_arg(p, "pc", 0)
                                fixup.append( p.name )
 
                print ''
 
                self.common_emit_fixups(fixup)
 
+               if img.img_null_flag:
+                       print ''
+                       print '    if (*(CARD32 *) (pc + %s))' % (img.offset - 4)
+                       print '        return 0;'
+
                print ''
                print '    return __glXImageSize(%s, %s, %s, %s, %s, %s,' % (img.img_format, img.img_type, img.img_target, w, h, d )
                print '                          image_height, row_length, skip_images,'
@@ -638,7 +637,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
                        self.common_func_print_just_header(f)
 
                        for p in params:
-                               self.common_emit_one_arg(p, "pc", "    ", 0 )
+                               self.common_emit_one_arg(p, "pc", 0)
 
 
                        print ''