Commit 83ca89e58cefcb3509c29ed2af21c4865ba032b7

Austin Annestrand 2024-08-08T19:53:32

CL: Update logic for default platform on context creation In ANGLE, when multiple backends are enabled (e.g. passthrough, Vulkan, etc.), each backend is its own platform. Existing validation code was failing in this case for clCreateContext in the event of user not manually specifying CL_CONTEXT_PLATFORM. Spec says implementation then decides which platform to be associated with that context. ANGLE has a Platform::GetDefault() routine that was used and it simply grabs the 1st platform from our platform list in ANGLE (passthrough mode platform object in this case). We erroneously fail the validation in the case where we pass Vulkan device in our device_list since default-platform != Vulkan-platform. Updating the logic to use device's platform (from list) as default case. For clCreateContextFromType, we can continue to use Platform::GetDefault() as this routine generates the appropriate device list for the user to query/get via clGetContextInfo. Bug: angleproject:42266872 Change-Id: I285459688309d1cc76ade5a8564164a5538e1eda Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5789652 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>