This was all broken, but happened to work when all the work was done
on a (single-stream) GPU anyway. It broke horribly when the CPU actually
needed to look at the data (for non-zerocopy H.264 encoding).
This is, as far as I know, the last fix needed to run Nageru on NVIDIA
GPUs (tested with a GTX 950). Encoding is still done by Quick Sync,
not NVENC.
int frame_type, int64_t pts, int64_t dts)
{
// Wait for the GPU to be done with the frame.
- glClientWaitSync(frame.fence.get(), 0, 0);
+ GLenum sync_status;
+ do {
+ sync_status = glClientWaitSync(frame.fence.get(), 0, 1000000000);
+ check_error();
+ } while (sync_status == GL_TIMEOUT_EXPIRED);
+ assert(sync_status != GL_WAIT_FAILED);
// Release back any input frames we needed to render this frame.
frame.input_frames.clear();