summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/pipebuffer
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-01-30 14:07:12 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-01-30 14:07:12 +0000
commit46edad7d29b6f65de46b9c9da6f66eb0b12e3f8c (patch)
tree2720cec2d7b8692f32fb64099f166bf2cda03f35 /src/gallium/auxiliary/pipebuffer
parentb3028acd98e2b7fd09344f9005c5b20bba91262c (diff)
parent7996b3e034f92eeceed3f3e7c01eb1f829d98b18 (diff)
Merge branch 'gallium-0.2' into gallium-winsys-private
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer.h8
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 7cba5fa441..d8f1f02d68 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;
}