mesa/st: remove redundant call to st_finish in CopyTexSubImage
[mesa.git] / src / mesa / glapi / glX_proto_size.py
index 18bfa1b71bca6aa7ca866a95689a3a8a5a2607c0..95cb5110cc3cc8d7dd08619883a90ddd33d15432 100644 (file)
@@ -447,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 ''
@@ -538,7 +530,7 @@ 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
@@ -589,6 +581,11 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
 
                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,'