mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Reduce amount of calls to video_driver_get_size
This commit is contained in:
parent
c5445d2980
commit
55b8b8c244
@ -332,14 +332,16 @@ static void d3d_viewport_info(void *data, struct video_viewport *vp)
|
||||
d3d->renderchain_driver->viewport_info(d3d, vp);
|
||||
}
|
||||
|
||||
static void d3d_overlay_render(d3d_video_t *d3d, overlay_t *overlay)
|
||||
static void d3d_overlay_render(d3d_video_t *d3d, video_frame_info_t *video_info,
|
||||
overlay_t *overlay)
|
||||
{
|
||||
struct video_viewport vp;
|
||||
unsigned width, height;
|
||||
void *verts;
|
||||
unsigned i;
|
||||
float vert[4][9];
|
||||
float overlay_width, overlay_height;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
|
||||
if (!d3d || !overlay || !overlay->tex)
|
||||
return;
|
||||
@ -429,8 +431,6 @@ static void d3d_overlay_render(d3d_video_t *d3d, overlay_t *overlay)
|
||||
{
|
||||
D3DVIEWPORT vp_full;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
vp_full.X = 0;
|
||||
vp_full.Y = 0;
|
||||
vp_full.Width = width;
|
||||
@ -1370,19 +1370,19 @@ static bool d3d_frame(void *data, const void *frame,
|
||||
uint64_t frame_count, unsigned pitch,
|
||||
const char *msg, video_frame_info_t *video_info)
|
||||
{
|
||||
unsigned width, height;
|
||||
static struct retro_perf_counter d3d_frame = {0};
|
||||
static struct
|
||||
retro_perf_counter d3d_frame = {0};
|
||||
unsigned i = 0;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
HWND window = win32_get_window();
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
|
||||
(void)i;
|
||||
|
||||
if (!frame)
|
||||
return true;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
performance_counter_init(&d3d_frame, "d3d_frame");
|
||||
performance_counter_start(&d3d_frame);
|
||||
|
||||
@ -1448,7 +1448,7 @@ static bool d3d_frame(void *data, const void *frame,
|
||||
#ifdef HAVE_MENU
|
||||
if (d3d->menu && d3d->menu->enabled)
|
||||
{
|
||||
d3d_overlay_render(d3d, d3d->menu);
|
||||
d3d_overlay_render(d3d, video_info, d3d->menu);
|
||||
menu_driver_frame(video_info);
|
||||
}
|
||||
#endif
|
||||
@ -1457,7 +1457,7 @@ 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]);
|
||||
d3d_overlay_render(d3d, video_info, &d3d->overlays[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user