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

code in render_chain.cpp
This commit is contained in:
twinaphex 2015-04-05 17:17:18 +02:00
parent aaee638f6d
commit c6458daa0e
3 changed files with 6 additions and 12 deletions

View File

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

View File

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

View File

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