Skip to content
Browse files

fixup - vertex buffer was not resized

  • Loading branch information...
1 parent bccabdd commit 957c35ac55996209d5fa4bbce8770fa6277258f9 @CrystalP committed Dec 27, 2011
Showing with 8 additions and 2 deletions.
  1. +7 −2 xbmc/cores/VideoRenderers/OverlayRendererDX.cpp
  2. +1 −0 xbmc/guilib/D3DResource.h
View
9 xbmc/cores/VideoRenderers/OverlayRendererDX.cpp
@@ -193,7 +193,7 @@ void COverlayQuadsDX::Update(CDVDOverlaySSA* o, double pts)
int render_change;
if(!convert_quad(o, pts, width, height, quads, &render_change))
return;
-
+
if (render_change == LIBASS_RENDER_NOCHANGE)
return;
@@ -211,7 +211,12 @@ void COverlayQuadsDX::Update(CDVDOverlaySSA* o, double pts)
return;
}
- if (m_vertex.Get() == NULL && !m_vertex.Create(sizeof(VERTEX) * 6 * quads.count, D3DUSAGE_WRITEONLY, m_fvf, g_Windowing.DefaultD3DPool()))
+ unsigned vertex_length = sizeof(VERTEX) * 6 * quads.count;
+
+ if (m_vertex.Get() && m_vertex.GetLength() < vertex_length)
+ m_vertex.Release();
+
+ if (!m_vertex.Get() && !m_vertex.Create(vertex_length, D3DUSAGE_WRITEONLY, m_fvf, g_Windowing.DefaultD3DPool()))
{
CLog::Log(LOGERROR, "%s - failed to create vertex buffer", __FUNCTION__);
m_texture.Release();
View
1 xbmc/guilib/D3DResource.h
@@ -122,6 +122,7 @@ class CD3DVertexBuffer : public ID3DResource
void Release();
bool Lock(UINT offset, UINT size, void **data, DWORD flags);
bool Unlock();
+ UINT GetLength() { return m_length; }
LPDIRECT3DVERTEXBUFFER9 Get() const { return m_vertex; };

0 comments on commit 957c35a

Please sign in to comment.
Something went wrong with that request. Please try again.