diff options
author | bobo1on1 <bob-nospam-@xbmc.org> | 2011-07-16 19:55:13 +0200 |
---|---|---|
committer | bobo1on1 <bob-nospam-@xbmc.org> | 2011-07-16 19:55:13 +0200 |
commit | e7e9818ed5bcd3f346478a53cd35e6654f05319d (patch) | |
tree | 8a4b960b33f9a7c3a79b1447feb2b0500f055355 | |
parent | c89c6e53416670d3dbc28741f8f67fbfcfc87632 (diff) |
fixed: don't use GL_ARB_occlusion_query in CRenderCaptureGL when CAPTUREFLAG_IMMEDIATELY is set
-rw-r--r-- | xbmc/cores/VideoRenderers/RenderCapture.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/xbmc/cores/VideoRenderers/RenderCapture.cpp b/xbmc/cores/VideoRenderers/RenderCapture.cpp index 6b85d6a636..442adc60e1 100644 --- a/xbmc/cores/VideoRenderers/RenderCapture.cpp +++ b/xbmc/cores/VideoRenderers/RenderCapture.cpp @@ -100,11 +100,12 @@ void CRenderCaptureGL::BeginRender() if (!m_pbo) glGenBuffersARB(1, &m_pbo); - if (!m_query) + if (!m_query && !(m_flags & CAPTUREFLAG_IMMEDIATELY)) glGenQueriesARB(1, &m_query); //start the occlusion query - glBeginQueryARB(GL_SAMPLES_PASSED_ARB, m_query); + if (m_query) + glBeginQueryARB(GL_SAMPLES_PASSED_ARB, m_query); //allocate data on the pbo and pixel buffer glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, m_pbo); @@ -134,7 +135,9 @@ void CRenderCaptureGL::EndRender() if (m_asyncSupported) { glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); - glEndQueryARB(GL_SAMPLES_PASSED_ARB); + + if (m_query) + glEndQueryARB(GL_SAMPLES_PASSED_ARB); if (m_flags & CAPTUREFLAG_IMMEDIATELY) PboToBuffer(); @@ -171,8 +174,10 @@ void CRenderCaptureGL::ReadOut() //when it is, the write into the pbo is probably done as well, //so it can be mapped and read without a busy wait - GLuint readout; - glGetQueryObjectuivARB(m_query, GL_QUERY_RESULT_AVAILABLE_ARB, &readout); + GLuint readout = 1; + if (m_query) + glGetQueryObjectuivARB(m_query, GL_QUERY_RESULT_AVAILABLE_ARB, &readout); + if (readout) PboToBuffer(); } |