Revert "(D3D) More refactors to do with hiding away vertex declaration"

This reverts commit c6458daa0e.
This commit is contained in:
twinaphex 2015-04-05 17:21:52 +02:00
parent c6458daa0e
commit 7f65bf700a
3 changed files with 12 additions and 6 deletions

View File

@ -149,17 +149,20 @@ void *d3d_vertex_buffer_lock(LPDIRECT3DVERTEXBUFFER vertbuf)
void d3d_vertex_buffer_free(void *vertex_data, void *vertex_declaration)
{
if (vertex_data)
#ifdef HAVE_D3D9
LPDIRECT3DVERTEXDECLARATION vertex_decl = (LPDIRECT3DVERTEXDECLARATION)vertex_declaration;
#endif
LPDIRECT3DVERTEXBUFFER buf = (LPDIRECT3DVERTEXBUFFER)vertex_data;
if (buf)
{
LPDIRECT3DVERTEXBUFFER buf = (LPDIRECT3DVERTEXBUFFER)vertex_data;
buf->Release();
buf = NULL;
}
#ifdef HAVE_D3D9
if (vertex_declaration)
if (vertex_decl)
{
LPDIRECT3DVERTEXDECLARATION vertex_decl = (LPDIRECT3DVERTEXDECLARATION)vertex_declaration;
vertex_decl->Release();
vertex_decl = NULL;
}

View File

@ -776,7 +776,8 @@ void renderchain_clear(void *data)
d3d_vertex_buffer_free(chain->prev.vertex_buf[i], NULL);
}
d3d_vertex_buffer_free(NULL, chain->passes[0].vertex_decl);
if (chain->passes[0].vertex_decl)
chain->passes[0].vertex_decl->Release();
for (i = 1; i < chain->passes.size(); i++)
{

View File

@ -54,7 +54,9 @@ struct Pass
CGprogram vPrg, fPrg;
#endif
unsigned last_width, last_height;
void *vertex_decl;
#ifdef HAVE_D3D9
LPDIRECT3DVERTEXDECLARATION vertex_decl;
#endif
std::vector<unsigned> attrib_map;
};