Skip to content

Commit

Permalink
CL/VK: Fix enqueueFillImage & enqueueMapImage lock and waitlist
Browse files Browse the repository at this point in the history
Fix in enqueueFillImage and enqueueMapImage.
Semantically should be using scoped lock and processWaitlist()
instead of enqueueWaitForEvents().

Bug: angleproject:390387802
Change-Id: I86173a079aa7fdd54a8b7158ec8214147cfb7cd2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6179619
Reviewed-by: Austin Annestrand <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
  • Loading branch information
Alex Dean authored and Angle LUCI CQ committed Jan 24, 2025
1 parent b5c1260 commit d926d80
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/libANGLE/renderer/vulkan/CLCommandQueueVk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,14 +950,16 @@ angle::Result CLCommandQueueVk::enqueueFillImage(const cl::Image &image,
const cl::EventPtrs &waitEvents,
CLEventImpl::CreateFunc *eventCreateFunc)
{
std::scoped_lock<std::mutex> sl(mCommandQueueMutex);

ANGLE_TRY(processWaitlist(waitEvents));

CLImageVk &imageVk = image.getImpl<CLImageVk>();
PixelColor packedColor;
cl::Extents extent = imageVk.getImageExtent();

imageVk.packPixels(fillColor, &packedColor);

ANGLE_TRY(enqueueWaitForEvents(waitEvents));

if (imageVk.isStagingBufferInitialized() == false)
{
ANGLE_TRY(imageVk.createStagingBuffer(imageVk.getSize()));
Expand Down Expand Up @@ -1037,7 +1039,9 @@ angle::Result CLCommandQueueVk::enqueueMapImage(const cl::Image &image,
CLEventImpl::CreateFunc *eventCreateFunc,
void *&mapPtr)
{
ANGLE_TRY(enqueueWaitForEvents(waitEvents));
std::scoped_lock<std::mutex> sl(mCommandQueueMutex);

ANGLE_TRY(processWaitlist(waitEvents));

// TODO: Look into better enqueue handling of this map-op if non-blocking
// https://anglebug.com/376722715
Expand Down

0 comments on commit d926d80

Please sign in to comment.