(D3D) Cleanups

This commit is contained in:
twinaphex 2016-10-20 05:05:37 +02:00
parent 2cb7cc01bf
commit e50f8b061d

View File

@ -351,15 +351,6 @@ static void d3d_overlay_render(d3d_video_t *d3d, overlay_t *overlay)
if (!d3d || !overlay || !overlay->tex)
return;
if (!overlay->vert_buf)
{
overlay->vert_buf = d3d_vertex_buffer_new(
d3d->dev, sizeof(vert), 0, 0, D3DPOOL_MANAGED, NULL);
if (!overlay->vert_buf)
return;
}
for (i = 0; i < 4; i++)
{
vert[i][2] = 0.5f;
@ -1520,8 +1511,18 @@ static bool d3d_frame(void *data, const void *frame,
#ifdef HAVE_MENU
if (d3d->menu && d3d->menu->enabled)
{
d3d_overlay_render(d3d, d3d->menu);
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
void *vert_buf = d3d->menu->vert_buf;
if (!vert_buf)
vert_buf = d3d_vertex_buffer_new(
d3d->dev, sizeof(vert), 0, 0, D3DPOOL_MANAGED, NULL);
if (vert_buf)
{
d3d->menu->vert_buf = vert_buf;
d3d_overlay_render(d3d, d3d->menu);
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
}
}
#endif
@ -1529,7 +1530,19 @@ static bool d3d_frame(void *data, const void *frame,
if (d3d->overlays_enabled)
{
for (i = 0; i < d3d->overlays.size(); i++)
d3d_overlay_render(d3d, &d3d->overlays[i]);
{
void *vert_buf = d3d->overlays[i].vert_buf;
if (!vert_buf)
vert_buf = d3d_vertex_buffer_new(
d3d->dev, sizeof(vert), 0, 0, D3DPOOL_MANAGED, NULL);
if (vert_buf)
{
d3d->overlays[i].vert_buf = vert_buf;
d3d_overlay_render(d3d, &d3d->overlays[i]);
}
}
}
#endif