rusticl: Fix the invalid memory migration flags check.

We want to know if you have any invalid flags set, not if you don't have
any valid flags set.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19446>
This commit is contained in:
Emma Anholt 2022-11-01 13:01:16 -07:00 committed by Marge Bot
parent 05a4d3f380
commit e4d61f37d4
2 changed files with 2 additions and 3 deletions

View file

@ -2,7 +2,6 @@ api/clbuildprogram: fail
api/clcompileprogram: fail
api/clcreateprogramwithbinary: fail
api/clenqueuefillimage: fail
api/clenqueuemigratememobjects: fail
api/clgetcommandqueueinfo: fail
api/clgetdeviceinfo: fail
api/clgetextensionfunctionaddressforplatform: fail

View file

@ -2137,9 +2137,9 @@ pub fn enqueue_migrate_mem_objects(
// CL_INVALID_VALUE if flags is not 0 or is not any of the values described in the table above.
if flags != 0
&& !bit_check(
&& bit_check(
flags,
CL_MIGRATE_MEM_OBJECT_HOST | CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED,
!(CL_MIGRATE_MEM_OBJECT_HOST | CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED),
)
{
return Err(CL_INVALID_VALUE);