projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f9fff2
)
pipebuffer: Consider 0 as no alignment needed.
author
José Fonseca
<jfonseca@vmware.com>
Fri, 30 Jan 2009 14:06:25 +0000
(14:06 +0000)
committer
José Fonseca
<jfonseca@vmware.com>
Fri, 30 Jan 2009 14:06:25 +0000
(14:06 +0000)
src/gallium/auxiliary/pipebuffer/pb_buffer.h
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/pipebuffer/pb_buffer.h
b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
index 7cba5fa441cb62659c7ad89af5e5f4309879ffd9..d8f1f02d681b792f40c8f8fa8200983528767760 100644
(file)
--- 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;
}