(D3D) Start going through d3d_texture_free/d3d_vertex_buffer_free

This commit is contained in:
twinaphex 2014-09-13 18:17:34 +02:00
parent 0b5a9a244c
commit 633c05d677
2 changed files with 12 additions and 12 deletions

View File

@ -1345,10 +1345,8 @@ static void d3d_free_overlay(void *data, overlay_t *overlay)
{ {
d3d_video_t *d3d = (d3d_video_t*)data; d3d_video_t *d3d = (d3d_video_t*)data;
if (overlay->tex) d3d_texture_free(overlay->tex);
overlay->tex->Release(); d3d_vertex_buffer_free(overlay->vert_buf);
if (overlay->vert_buf)
overlay->vert_buf->Release();
} }
static void d3d_free_overlays(void *data) static void d3d_free_overlays(void *data)
@ -1752,8 +1750,9 @@ static void d3d_set_menu_texture_frame(void *data,
if (!d3d->menu->tex || d3d->menu->tex_w != width if (!d3d->menu->tex || d3d->menu->tex_w != width
|| d3d->menu->tex_h != height) || d3d->menu->tex_h != height)
{ {
if (d3d->menu && d3d->menu->tex) if (d3d->menu)
d3d->menu->tex->Release(); d3d_texture_free(d3d->menu->tex);
if (FAILED(d3d->dev->CreateTexture(width, height, 1, if (FAILED(d3d->dev->CreateTexture(width, height, 1,
0, D3DFMT_A8R8G8B8, 0, D3DFMT_A8R8G8B8,
D3DPOOL_MANAGED, D3DPOOL_MANAGED,

View File

@ -77,9 +77,9 @@ void renderchain_clear(void *data)
for (unsigned i = 0; i < TEXTURES; i++) for (unsigned i = 0; i < TEXTURES; i++)
{ {
if (chain->prev.tex[i]) if (chain->prev.tex[i])
chain->prev.tex[i]->Release(); d3d_texture_free(chain->prev.tex[i]);
if (chain->prev.vertex_buf[i]) if (chain->prev.vertex_buf[i])
chain->prev.vertex_buf[i]->Release(); d3d_vertex_buffer_free(chain->prev.vertex_buf[i]);
} }
if (chain->passes[0].vertex_decl) if (chain->passes[0].vertex_decl)
@ -87,9 +87,9 @@ void renderchain_clear(void *data)
for (unsigned i = 1; i < chain->passes.size(); i++) for (unsigned i = 1; i < chain->passes.size(); i++)
{ {
if (chain->passes[i].tex) if (chain->passes[i].tex)
chain->passes[i].tex->Release(); d3d_texture_free(chain->passes[i].tex);
if (chain->passes[i].vertex_buf) if (chain->passes[i].vertex_buf)
chain->passes[i].vertex_buf->Release(); d3d_vertex_buffer_free(chain->passes[i].vertex_buf);
if (chain->passes[i].vertex_decl) if (chain->passes[i].vertex_decl)
chain->passes[i].vertex_decl->Release(); chain->passes[i].vertex_decl->Release();
renderchain_destroy_shader(chain, i); renderchain_destroy_shader(chain, i);
@ -98,7 +98,7 @@ void renderchain_clear(void *data)
for (unsigned i = 0; i < chain->luts.size(); i++) for (unsigned i = 0; i < chain->luts.size(); i++)
{ {
if (chain->luts[i].tex) if (chain->luts[i].tex)
chain->luts[i].tex->Release(); d3d_texture_free(chain->luts[i].tex);
} }
chain->passes.clear(); chain->passes.clear();
@ -120,7 +120,8 @@ bool renderchain_set_pass_size(void *data, unsigned pass_index,
Pass *pass = (Pass*)&chain->passes[pass_index]; Pass *pass = (Pass*)&chain->passes[pass_index];
if (width != pass->info.tex_w || height != pass->info.tex_h) if (width != pass->info.tex_w || height != pass->info.tex_h)
{ {
pass->tex->Release(); d3d_texture_free(pass->tex);
pass->info.tex_w = width; pass->info.tex_w = width;
pass->info.tex_h = height; pass->info.tex_h = height;