summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/pipebuffer
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-01-30 14:06:25 +0000
committerJosé Fonseca <[email protected]>2009-01-30 14:06:25 +0000
commit7996b3e034f92eeceed3f3e7c01eb1f829d98b18 (patch)
tree2d3d2a7ab830a77b9804657b9ef2d7b50c95e510 /src/gallium/auxiliary/pipebuffer
parent1f9fff28a441360077f2098965bb358c366debdc (diff)
pipebuffer: Consider 0 as no alignment needed.
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 7cba5fa441c..d8f1f02d681 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;
}