Module: Mesa
Branch: gallium-winsys-private
Commit: 7996b3e034f92eeceed3f3e7c01eb1f829d98b18
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7996b3e034f92eeceed3f3e7c01eb1f829d98b18

Author: José Fonseca <jfons...@vmware.com>
Date:   Fri Jan 30 14:06:25 2009 +0000

pipebuffer: Consider 0 as no alignment needed.

---

 src/gallium/auxiliary/pipebuffer/pb_buffer.h |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h 
b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
index 7cba5fa..d8f1f02 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
@@ -255,7 +255,13 @@ pb_reference(struct pb_buffer **dst,
 static INLINE boolean
 pb_check_alignment(size_t requested, size_t provided)
 {
-   return requested <= provided && (provided % requested) == 0 ? TRUE : FALSE;
+   if(!requested)
+      return TRUE;
+   if(requested > provided)
+      return FALSE;
+   if(provided % requested != 0)
+      return FALSE;
+   return TRUE;
 }
 
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to