mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-20 18:40:39 +02:00
pipebuffer: Consider 0 as no alignment needed.
This commit is contained in:
parent
1f9fff28a4
commit
7996b3e034
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue