drisw: add comment to libGL about stride
authorGeorge Sapountzis <gsapountzis@gmail.com>
Sat, 27 Mar 2010 19:35:25 +0000 (21:35 +0200)
committerGeorge Sapountzis <gsapountzis@gmail.com>
Sat, 27 Mar 2010 19:35:25 +0000 (21:35 +0200)
src/gallium/winsys/sw/dri/dri_sw_winsys.c
src/glx/drisw_glx.c
src/mesa/drivers/dri/swrast/swrast.c

index 9e8c31282d4beec9edf4ad66c3d0bcf209182171..ee8ec91bc520f30e94320a3e229c662fc308aa55 100644 (file)
@@ -62,6 +62,7 @@ xm_is_displaytarget_format_supported( struct sw_winsys *ws,
    return TRUE;
 }
 
+/* see bytes_per_line in libGL */
 static INLINE int
 bytes_per_line(unsigned pitch_bits, unsigned mul)
 {
index ca85ae3a3133816be5280d1e678d0ee241522ba9..5a47e4a097f47f4fa643f018d33adcf71a632a74 100644 (file)
@@ -90,7 +90,7 @@ XCreateDrawable(__GLXDRIdrawablePrivate * pdp,
                               ZPixmap, 0,             /* format, offset */
                               NULL,                   /* data */
                               0, 0,                   /* width, height */
-                              8,                      /* bitmap_pad */
+                              32,                     /* bitmap_pad */
                               0);                     /* bytes_per_line */
 
    return True;
@@ -188,6 +188,14 @@ swrastGetImage2(__DRIdrawable * read,
    ximage->data = NULL;
 }
 
+/**
+ * Renderbuffer pitch alignment (in bits).
+ *
+ * This should be chosen by the driver and the loader (libGL, xserver/glx)
+ * should use the driver provided pitch. I had a comment that the xserver
+ * requires padding images to 32 bits. Is this a hard requirement or can it use
+ * the driver pitch without extra copies ? XXX
+ */
 static inline int
 bytes_per_line(unsigned pitch_bits, unsigned mul)
 {
index e8df26f3d063707a08efe0909d8b328fffac0f5f..8b68281fab0c39255f4d8248bca98c02bfaf3ac2 100644 (file)
@@ -206,6 +206,7 @@ swrast_delete_renderbuffer(struct gl_renderbuffer *rb)
     free(rb);
 }
 
+/* see bytes_per_line in libGL */
 static INLINE int
 bytes_per_line(unsigned pitch_bits, unsigned mul)
 {