diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-01-30 14:06:25 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-01-30 14:06:25 +0000 |
commit | 7996b3e034f92eeceed3f3e7c01eb1f829d98b18 (patch) | |
tree | 2d3d2a7ab830a77b9804657b9ef2d7b50c95e510 /src | |
parent | 1f9fff28a441360077f2098965bb358c366debdc (diff) |
pipebuffer: Consider 0 as no alignment needed.
Diffstat (limited to 'src')
-rw-r--r-- | 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 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; } |