void CRendererVTB::AfterRenderHook(int idx) { CRenderBuffer &buf = m_vtbBuffers[idx]; if (buf.m_fence && glIsSyncAPPLE(buf.m_fence)) { glDeleteSyncAPPLE(buf.m_fence); } buf.m_fence = glFenceSyncAPPLE(GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE, 0); }
void CRendererVTB::ReleaseBuffer(int idx) { CRenderBuffer &buf = m_vtbBuffers[idx]; if (buf.m_videoBuffer) CVBufferRelease(buf.m_videoBuffer); buf.m_videoBuffer = nullptr; if (buf.m_fence && glIsSyncAPPLE(buf.m_fence)) { glDeleteSyncAPPLE(buf.m_fence); buf.m_fence = nullptr; } }
bool CRendererVTB::NeedBuffer(int idx) { CRenderBuffer &buf = m_vtbBuffers[idx]; if (buf.m_fence && glIsSyncAPPLE(buf.m_fence)) { int syncState = GL_UNSIGNALED_APPLE; glGetSyncivAPPLE(buf.m_fence, GL_SYNC_STATUS_APPLE, 1, nullptr, &syncState); if (syncState == GL_SIGNALED_APPLE) return false; } return true; }
void CRendererVTB::ReleaseBuffer(int idx) { YUVBUFFER &buf = m_buffers[idx]; CRenderBuffer &renderBuf = m_vtbBuffers[idx]; if (buf.videoBuffer) { if (renderBuf.m_fence && glIsSyncAPPLE(renderBuf.m_fence)) { glDeleteSyncAPPLE(renderBuf.m_fence); renderBuf.m_fence = 0; } buf.videoBuffer->Release(); buf.videoBuffer = nullptr; } }
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengles_APPLESync_nglIsSyncAPPLE(JNIEnv *__env, jclass clazz, jlong syncAddress) { glIsSyncAPPLEPROC glIsSyncAPPLE = (glIsSyncAPPLEPROC)tlsGetFunction(379); intptr_t sync = (intptr_t)syncAddress; UNUSED_PARAM(clazz) return (jboolean)glIsSyncAPPLE(sync); }