Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rendermanager: adjust displayed render buffer for ati

  • Loading branch information...
commit ab4b60c33f3c27ad5efaf0d6cf61c98c247bc36c 1 parent 7c77d30
@FernetMenta authored
View
15 xbmc/cores/VideoRenderers/RenderManager.cpp
@@ -54,6 +54,8 @@
#include "../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h"
#include "../dvdplayer/DVDCodecs/DVDCodecUtils.h"
+#include "windowing/WindowingFactory.h"
+
#define MAXPRESENTDELAY 0.500
/* at any point we want an exclusive lock on rendermanager */
@@ -332,6 +334,13 @@ unsigned int CXBMCRenderManager::PreInit(CDVDClock *pClock)
UpdateDisplayLatency();
+ m_swapCount = 1;
+ std::string Vendor = g_Windowing.GetRenderVendor();
+ std::transform(Vendor.begin(), Vendor.end(), Vendor.begin(), ::tolower);
+ if (Vendor.compare(0, 3, "ati") == 0)
+ {
+ m_swapCount = 2;
+ }
ResetRenderBuffer();
m_bUseBuffering = false;
m_overlays.SetNumBuffers(m_iNumRenderBuffers);
@@ -906,9 +915,9 @@ bool CXBMCRenderManager::HasFreeBuffer()
return true;
}
- int outputPlus1 = (m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers;
+ int outputPlusSwap = (m_iOutputRenderBuffer + m_swapCount) % m_iNumRenderBuffers;
if ((m_iOutputRenderBuffer == m_iDisplayedRenderBuffer && !m_bAllRenderBuffersDisplayed)
- || outputPlus1 == m_iCurrentRenderBuffer)
+ || outputPlusSwap == m_iCurrentRenderBuffer)
return false;
else
return true;
@@ -995,7 +1004,7 @@ void CXBMCRenderManager::NotifyDisplayFlip()
// }
int last = m_iDisplayedRenderBuffer;
- m_iDisplayedRenderBuffer = (m_iCurrentRenderBuffer + m_iNumRenderBuffers - 1) % m_iNumRenderBuffers;
+ m_iDisplayedRenderBuffer = (m_iCurrentRenderBuffer + m_iNumRenderBuffers - m_swapCount) % m_iNumRenderBuffers;
m_iFlipRequestRenderBuffer = m_iCurrentRenderBuffer;
// // we have caught up with output so all buffers are re-usable
View
1  xbmc/cores/VideoRenderers/RenderManager.h
@@ -285,6 +285,7 @@ class CXBMCRenderManager
CEvent m_flushEvent;
CDVDClock *m_pClock;
uint64_t m_rendertime;
+ unsigned int m_swapCount;
OVERLAY::CRenderer m_overlays;
Please sign in to comment.
Something went wrong with that request. Please try again.