(Video drivers) Cleanups

This commit is contained in:
twinaphex 2020-03-09 16:24:20 +01:00
parent 9e9ad8d5eb
commit 4e6f26d2e4
3 changed files with 30 additions and 24 deletions

View File

@ -1282,11 +1282,15 @@ static bool d3d11_gfx_frame(
video_frame_info_t* video_info)
{
unsigned i;
d3d11_texture_t* texture = NULL;
d3d11_video_t* d3d11 = (d3d11_video_t*)data;
D3D11DeviceContext context = d3d11->context;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
d3d11_texture_t* texture = NULL;
d3d11_video_t* d3d11 = (d3d11_video_t*)data;
D3D11DeviceContext context = d3d11->context;
bool widgets_inited = video_info->widgets_inited;
const char *stat_text = video_info->stat_text;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
bool statistics_show = video_info->statistics_show;
struct font_params* osd_params = (struct font_params*)&video_info->osd_stat_params;
if (d3d11->resize_chain)
{
@ -1544,18 +1548,16 @@ static bool d3d11_gfx_frame(
menu_driver_frame(video_info);
else
#endif
if (video_info->statistics_show)
if (statistics_show)
{
struct font_params* osd_params = (struct font_params*)&video_info->osd_stat_params;
if (osd_params)
{
D3D11SetViewports(context, 1, &d3d11->viewport);
D3D11SetBlendState(d3d11->context, d3d11->blend_enable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
D3D11SetVertexBuffer(context, 0, d3d11->sprites.vbo, sizeof(d3d11_sprite_t), 0);
font_driver_render_msg(d3d11,
video_info, video_info->stat_text,
(const struct font_params*)&video_info->osd_stat_params, NULL);
video_info, stat_text,
(const struct font_params*)osd_params, NULL);
}
}
@ -1581,7 +1583,7 @@ static bool d3d11_gfx_frame(
#endif
#ifdef HAVE_GFX_WIDGETS
if (video_info->widgets_inited)
if (widgets_inited)
gfx_widgets_frame(video_info);
#endif

View File

@ -1166,10 +1166,16 @@ static bool d3d12_gfx_frame(
video_frame_info_t* video_info)
{
unsigned i;
d3d12_texture_t* texture = NULL;
d3d12_video_t* d3d12 = (d3d12_video_t*)data;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
d3d12_texture_t* texture = NULL;
d3d12_video_t* d3d12 = (d3d12_video_t*)data;
const char *stat_text = video_info->stat_text;
bool statistics_show = video_info->statistics_show;
bool widgets_inited = video_info->widgets_inited;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
struct font_params *osd_params = (struct font_params*)
&video_info->osd_stat_params;
d3d12_gfx_sync(d3d12);
@ -1511,19 +1517,16 @@ static bool d3d12_gfx_frame(
menu_driver_frame(video_info);
else
#endif
if (video_info->statistics_show)
if (statistics_show)
{
struct font_params *osd_params = (struct font_params*)
&video_info->osd_stat_params;
if (osd_params)
{
D3D12SetPipelineState(d3d12->queue.cmd, d3d12->sprites.pipe_blend);
D3D12RSSetViewports(d3d12->queue.cmd, 1, &d3d12->chain.viewport);
D3D12RSSetScissorRects(d3d12->queue.cmd, 1, &d3d12->chain.scissorRect);
D3D12IASetVertexBuffers(d3d12->queue.cmd, 0, 1, &d3d12->sprites.vbo_view);
font_driver_render_msg(d3d12, video_info, video_info->stat_text,
(const struct font_params*)&video_info->osd_stat_params, NULL);
font_driver_render_msg(d3d12, video_info, stat_text,
(const struct font_params*)osd_params, NULL);
}
}
#ifdef HAVE_OVERLAY
@ -1563,7 +1566,7 @@ static bool d3d12_gfx_frame(
#endif
#ifdef HAVE_GFX_WIDGETS
if (video_info->widgets_inited)
if (widgets_inited)
gfx_widgets_frame(video_info);
#endif

View File

@ -437,7 +437,8 @@ static bool dispmanx_gfx_frame(void *data, const void *frame, unsigned width,
video_frame_info_t *video_info)
{
struct dispmanx_video *_dispvars = data;
float aspect = video_driver_get_aspect_ratio();
float aspect = video_driver_get_aspect_ratio();
unsigned max_swapchain_images = video_info->max_swapchain_images;
if (!frame)
return true;
@ -468,7 +469,7 @@ static bool dispmanx_gfx_frame(void *data, const void *frame, unsigned width,
_dispvars->rgb32 ? VC_IMAGE_XRGB8888 : VC_IMAGE_RGB565,
255,
_dispvars->aspect_ratio,
video_info->max_swapchain_images,
max_swapchain_images,
0,
&_dispvars->main_surface);