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:
@@ -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++]);
|
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()
|
void finish()
|
||||||
|
|||||||
Reference in New Issue
Block a user