Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixup - vertex buffer was not resized

  • Loading branch information...
commit 957c35ac55996209d5fa4bbce8770fa6277258f9 1 parent bccabdd
CrystalP authored
9 xbmc/cores/VideoRenderers/OverlayRendererDX.cpp
@@ -193,7 +193,7 @@ void COverlayQuadsDX::Update(CDVDOverlaySSA* o, double pts)
193 193 int render_change;
194 194 if(!convert_quad(o, pts, width, height, quads, &render_change))
195 195 return;
196   -
  196 +
197 197 if (render_change == LIBASS_RENDER_NOCHANGE)
198 198 return;
199 199
@@ -211,7 +211,12 @@ void COverlayQuadsDX::Update(CDVDOverlaySSA* o, double pts)
211 211 return;
212 212 }
213 213
214   - if (m_vertex.Get() == NULL && !m_vertex.Create(sizeof(VERTEX) * 6 * quads.count, D3DUSAGE_WRITEONLY, m_fvf, g_Windowing.DefaultD3DPool()))
  214 + unsigned vertex_length = sizeof(VERTEX) * 6 * quads.count;
  215 +
  216 + if (m_vertex.Get() && m_vertex.GetLength() < vertex_length)
  217 + m_vertex.Release();
  218 +
  219 + if (!m_vertex.Get() && !m_vertex.Create(vertex_length, D3DUSAGE_WRITEONLY, m_fvf, g_Windowing.DefaultD3DPool()))
215 220 {
216 221 CLog::Log(LOGERROR, "%s - failed to create vertex buffer", __FUNCTION__);
217 222 m_texture.Release();
1  xbmc/guilib/D3DResource.h
@@ -122,6 +122,7 @@ class CD3DVertexBuffer : public ID3DResource
122 122 void Release();
123 123 bool Lock(UINT offset, UINT size, void **data, DWORD flags);
124 124 bool Unlock();
  125 + UINT GetLength() { return m_length; }
125 126
126 127 LPDIRECT3DVERTEXBUFFER9 Get() const { return m_vertex; };
127 128

0 comments on commit 957c35a

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