示例#1
0
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);
}
示例#2
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;
  }
}
示例#3
0
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;
}
示例#4
0
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);
}