gpu: fix clEnqueueReleaseGLObjects call with no wait list

The spec prohibits calling clEnqueueReleaseGLObjects with 0 for
num_events_in_wait_list but a non-null event_wait_list. Special
case passing a null wait list when there are no compute events
to wait for.
This commit is contained in:
Adam
2021-03-23 13:48:55 -04:00
parent ad10d6d6c1
commit 9d048fce41

View File

@@ -511,7 +511,14 @@ class OpenCLManager
new long[]{(long) largeModels * (LARGE_SIZE / largeFaceCount)}, new long[]{LARGE_SIZE / largeFaceCount}, 1, new cl_event[]{acquireGLBuffers}, computeEvents[numComputeEvents++]);
}
clEnqueueReleaseGLObjects(commandQueue, glBuffers.length, glBuffers, numComputeEvents, computeEvents, null);
if (numComputeEvents == 0)
{
clEnqueueReleaseGLObjects(commandQueue, glBuffers.length, glBuffers, 0, null, null);
}
else
{
clEnqueueReleaseGLObjects(commandQueue, glBuffers.length, glBuffers, numComputeEvents, computeEvents, null);
}
}
void finish()