mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-02 15:05:09 +00:00
Reduce calls to video_driver_get_ptr - set it once for
video_frame_info_t
This commit is contained in:
parent
1e2d8de9ca
commit
964e9db588
@ -2708,6 +2708,7 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||
video_info->cb_shader_use = video_driver_cb_shader_use;
|
||||
video_info->cb_set_mvp = video_driver_cb_shader_set_mvp;
|
||||
|
||||
video_info->userdata = video_driver_get_ptr(false);
|
||||
#if 0
|
||||
video_info->cb_set_coords = video_driver_cb_set_coords;
|
||||
#endif
|
||||
|
@ -476,6 +476,7 @@ typedef struct video_frame_info
|
||||
|
||||
void *context_data;
|
||||
void *shader_data;
|
||||
void *userdata;
|
||||
} video_frame_info_t;
|
||||
|
||||
typedef void (*update_window_title_cb)(void*, void*);
|
||||
|
@ -321,6 +321,7 @@ static void mui_context_reset_textures(mui_handle_t *mui)
|
||||
}
|
||||
|
||||
static void mui_draw_icon(
|
||||
video_frame_info_t *video_info,
|
||||
unsigned icon_size,
|
||||
uintptr_t texture,
|
||||
float x, float y,
|
||||
@ -333,7 +334,7 @@ static void mui_draw_icon(
|
||||
struct video_coords coords;
|
||||
math_matrix_4x4 mymat;
|
||||
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
rotate_draw.matrix = &mymat;
|
||||
rotate_draw.rotation = rotation;
|
||||
@ -361,11 +362,13 @@ static void mui_draw_icon(
|
||||
draw.pipeline.id = 0;
|
||||
|
||||
menu_display_draw(&draw);
|
||||
menu_display_blend_end();
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
|
||||
/* Draw a single tab */
|
||||
static void mui_draw_tab(mui_handle_t *mui,
|
||||
static void mui_draw_tab(
|
||||
mui_handle_t *mui,
|
||||
video_frame_info_t *video_info,
|
||||
unsigned i,
|
||||
unsigned width, unsigned height,
|
||||
float *tab_color,
|
||||
@ -392,7 +395,7 @@ static void mui_draw_tab(mui_handle_t *mui,
|
||||
break;
|
||||
}
|
||||
|
||||
mui_draw_icon(
|
||||
mui_draw_icon(video_info,
|
||||
mui->icon_size,
|
||||
mui->textures.list[tab_icon],
|
||||
width / (MUI_SYSTEM_TAB_END+1) * (i+0.5) - mui->icon_size/2,
|
||||
@ -427,7 +430,10 @@ static void mui_render_keyboard(mui_handle_t *mui,
|
||||
1.00, 1.00, 1.00, 1.00,
|
||||
};
|
||||
|
||||
menu_display_draw_quad(0, height/2.0, width, height/2.0,
|
||||
menu_display_draw_quad(
|
||||
video_info,
|
||||
0,
|
||||
height/2.0, width, height/2.0,
|
||||
width, height,
|
||||
&dark[0]);
|
||||
|
||||
@ -445,7 +451,7 @@ static void mui_render_keyboard(mui_handle_t *mui,
|
||||
if (i == id)
|
||||
texture = mui->textures.list[MUI_TEXTURE_KEY_HOVER];
|
||||
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
menu_display_draw_texture(
|
||||
width/2.0 - (11*ptr_width)/2.0 + (i % 11) * ptr_width,
|
||||
@ -495,7 +501,9 @@ static int mui_osk_ptr_at_pos(void *data, int x, int y,
|
||||
}
|
||||
|
||||
/* Draw the tabs background */
|
||||
static void mui_draw_tab_begin(mui_handle_t *mui,
|
||||
static void mui_draw_tab_begin(
|
||||
mui_handle_t *mui,
|
||||
video_frame_info_t *video_info,
|
||||
unsigned width, unsigned height,
|
||||
float *tabs_bg_color, float *tabs_separator_color)
|
||||
{
|
||||
@ -504,13 +512,17 @@ static void mui_draw_tab_begin(mui_handle_t *mui,
|
||||
mui->tabs_height = scale_factor / 3;
|
||||
|
||||
/* tabs background */
|
||||
menu_display_draw_quad(0, height - mui->tabs_height, width,
|
||||
menu_display_draw_quad(
|
||||
video_info,
|
||||
0, height - mui->tabs_height, width,
|
||||
mui->tabs_height,
|
||||
width, height,
|
||||
tabs_bg_color);
|
||||
|
||||
/* tabs separator */
|
||||
menu_display_draw_quad(0, height - mui->tabs_height, width,
|
||||
menu_display_draw_quad(
|
||||
video_info,
|
||||
0, height - mui->tabs_height, width,
|
||||
1,
|
||||
width, height,
|
||||
tabs_separator_color);
|
||||
@ -518,6 +530,7 @@ static void mui_draw_tab_begin(mui_handle_t *mui,
|
||||
|
||||
/* Draw the active tab */
|
||||
static void mui_draw_tab_end(mui_handle_t *mui,
|
||||
video_frame_info_t *video_info,
|
||||
unsigned width, unsigned height,
|
||||
unsigned header_height,
|
||||
float *active_tab_marker_color)
|
||||
@ -526,7 +539,8 @@ static void mui_draw_tab_end(mui_handle_t *mui,
|
||||
unsigned tab_width = width / (MUI_SYSTEM_TAB_END+1);
|
||||
|
||||
menu_display_draw_quad(
|
||||
(int)(mui->categories_selection_ptr * tab_width),
|
||||
video_info,
|
||||
(int)(mui->categories_selection_ptr * tab_width),
|
||||
height - (header_height/16),
|
||||
tab_width,
|
||||
header_height/16,
|
||||
@ -536,6 +550,7 @@ static void mui_draw_tab_end(mui_handle_t *mui,
|
||||
|
||||
/* Draw the scrollbar */
|
||||
static void mui_draw_scrollbar(mui_handle_t *mui,
|
||||
video_frame_info_t *video_info,
|
||||
unsigned width, unsigned height, float *coord_color)
|
||||
{
|
||||
unsigned header_height = menu_display_get_header_height();
|
||||
@ -556,6 +571,7 @@ static void mui_draw_scrollbar(mui_handle_t *mui,
|
||||
scrollbar_height = mui->scrollbar_width;
|
||||
|
||||
menu_display_draw_quad(
|
||||
video_info,
|
||||
width - mui->scrollbar_width - scrollbar_margin,
|
||||
header_height + y,
|
||||
mui->scrollbar_width,
|
||||
@ -621,6 +637,7 @@ static void mui_render_messagebox(mui_handle_t *mui,
|
||||
menu_display_set_alpha(body_bg_color, 1.0);
|
||||
|
||||
menu_display_draw_quad(
|
||||
video_info,
|
||||
x - longest_width / 2.0 - mui->margin * 2.0,
|
||||
y - line_height / 2.0 - mui->margin * 2.0,
|
||||
longest_width + mui->margin * 4.0,
|
||||
@ -810,7 +827,10 @@ static void mui_render(void *data, bool is_idle)
|
||||
}
|
||||
|
||||
/* Display an entry value on the right of the screen. */
|
||||
static void mui_render_label_value(mui_handle_t *mui, mui_node_t *node,
|
||||
static void mui_render_label_value(
|
||||
mui_handle_t *mui,
|
||||
video_frame_info_t *video_info,
|
||||
mui_node_t *node,
|
||||
int i, int y, unsigned width, unsigned height,
|
||||
uint64_t index, uint32_t color, bool selected, const char *label,
|
||||
const char *value, float *label_color,
|
||||
@ -961,7 +981,7 @@ static void mui_render_label_value(mui_handle_t *mui, mui_node_t *node,
|
||||
width, height, color, TEXT_ALIGN_RIGHT, 1.0f, false, 0);
|
||||
|
||||
if (texture_switch2)
|
||||
mui_draw_icon(
|
||||
mui_draw_icon(video_info,
|
||||
mui->icon_size,
|
||||
(uintptr_t)texture_switch2,
|
||||
0,
|
||||
@ -974,7 +994,7 @@ static void mui_render_label_value(mui_handle_t *mui, mui_node_t *node,
|
||||
);
|
||||
|
||||
if (texture_switch)
|
||||
mui_draw_icon(
|
||||
mui_draw_icon(video_info,
|
||||
mui->icon_size,
|
||||
(uintptr_t)texture_switch,
|
||||
width - mui->margin - mui->icon_size,
|
||||
@ -1046,6 +1066,7 @@ static void mui_render_menu_list(
|
||||
|
||||
mui_render_label_value(
|
||||
mui,
|
||||
video_info,
|
||||
node,
|
||||
(int)i,
|
||||
y,
|
||||
@ -1119,7 +1140,7 @@ static void mui_draw_bg(menu_display_ctx_draw_t *draw,
|
||||
bool add_opacity = false;
|
||||
float opacity_override = video_info->menu_wallpaper_opacity;
|
||||
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
draw->x = 0;
|
||||
draw->y = 0;
|
||||
@ -1135,7 +1156,7 @@ static void mui_draw_bg(menu_display_ctx_draw_t *draw,
|
||||
menu_display_draw_bg(draw, video_info, add_opacity,
|
||||
opacity_override);
|
||||
menu_display_draw(draw);
|
||||
menu_display_blend_end();
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
|
||||
/* Main function of the menu driver. Takes care of drawing the header, the tabs,
|
||||
@ -1488,14 +1509,15 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
if (node)
|
||||
menu_display_draw_quad(
|
||||
0,
|
||||
header_height - mui->scroll_y + node->y,
|
||||
width,
|
||||
node->line_height,
|
||||
width,
|
||||
height,
|
||||
&highlighted_entry_color[0]
|
||||
);
|
||||
video_info,
|
||||
0,
|
||||
header_height - mui->scroll_y + node->y,
|
||||
width,
|
||||
node->line_height,
|
||||
width,
|
||||
height,
|
||||
&highlighted_entry_color[0]
|
||||
);
|
||||
|
||||
font_driver_bind_block(mui->font, &mui->raster_block);
|
||||
font_driver_bind_block(mui->font2, &mui->raster_block2);
|
||||
@ -1524,42 +1546,50 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
/* header */
|
||||
menu_display_draw_quad(
|
||||
0,
|
||||
0,
|
||||
width,
|
||||
header_height,
|
||||
width,
|
||||
height,
|
||||
&header_bg_color[0]);
|
||||
video_info,
|
||||
0,
|
||||
0,
|
||||
width,
|
||||
header_height,
|
||||
width,
|
||||
height,
|
||||
&header_bg_color[0]);
|
||||
|
||||
mui->tabs_height = 0;
|
||||
|
||||
/* display tabs if depth equal one, if not hide them */
|
||||
if (mui_list_get_size(mui, MENU_LIST_PLAIN) == 1)
|
||||
{
|
||||
mui_draw_tab_begin(mui, width, height, &footer_bg_color[0], &grey_bg[0]);
|
||||
mui_draw_tab_begin(mui,
|
||||
video_info,
|
||||
width, height, &footer_bg_color[0], &grey_bg[0]);
|
||||
|
||||
for (i = 0; i <= MUI_SYSTEM_TAB_END; i++)
|
||||
mui_draw_tab(mui, i, width, height, &passive_tab_icon_color[0], &active_tab_marker_color[0]);
|
||||
mui_draw_tab(mui, video_info,
|
||||
i, width, height,
|
||||
&passive_tab_icon_color[0], &active_tab_marker_color[0]);
|
||||
|
||||
mui_draw_tab_end(mui, width, height, header_height, &active_tab_marker_color[0]);
|
||||
mui_draw_tab_end(mui,
|
||||
video_info,
|
||||
width, height, header_height, &active_tab_marker_color[0]);
|
||||
}
|
||||
|
||||
menu_display_draw_quad(
|
||||
0,
|
||||
header_height,
|
||||
width,
|
||||
mui->shadow_height,
|
||||
width,
|
||||
height,
|
||||
&shadow_bg[0]);
|
||||
video_info,
|
||||
0,
|
||||
header_height,
|
||||
width,
|
||||
mui->shadow_height,
|
||||
width,
|
||||
height,
|
||||
&shadow_bg[0]);
|
||||
|
||||
title_margin = mui->margin;
|
||||
|
||||
if (menu_entries_ctl(MENU_ENTRIES_CTL_SHOW_BACK, NULL))
|
||||
{
|
||||
title_margin = mui->icon_size;
|
||||
mui_draw_icon(
|
||||
mui_draw_icon(video_info,
|
||||
mui->icon_size,
|
||||
mui->textures.list[MUI_TEXTURE_BACK],
|
||||
0,
|
||||
@ -1614,14 +1644,15 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
|
||||
header_height / 2 + mui->font->size / 3,
|
||||
width, height, font_header_color, TEXT_ALIGN_LEFT, 1.0f, false, 0);
|
||||
|
||||
mui_draw_scrollbar(mui, width, height, &grey_bg[0]);
|
||||
mui_draw_scrollbar(mui, video_info, width, height, &grey_bg[0]);
|
||||
|
||||
if (menu_input_dialog_get_display_kb())
|
||||
{
|
||||
const char *str = menu_input_dialog_get_buffer();
|
||||
const char *label = menu_input_dialog_get_label_buffer();
|
||||
|
||||
menu_display_draw_quad(0, 0, width, height, width, height, &black_bg[0]);
|
||||
menu_display_draw_quad(video_info,
|
||||
0, 0, width, height, width, height, &black_bg[0]);
|
||||
snprintf(msg, sizeof(msg), "%s\n%s", label, str);
|
||||
|
||||
mui_render_messagebox(mui, video_info,
|
||||
@ -1630,7 +1661,8 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
if (!string_is_empty(mui->box_message))
|
||||
{
|
||||
menu_display_draw_quad(0, 0, width, height, width, height, &black_bg[0]);
|
||||
menu_display_draw_quad(video_info,
|
||||
0, 0, width, height, width, height, &black_bg[0]);
|
||||
|
||||
mui_render_messagebox(mui, video_info,
|
||||
mui->box_message, &body_bg_color[0], font_hover_color);
|
||||
@ -1641,6 +1673,7 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
if (mui->mouse_show)
|
||||
menu_display_draw_cursor(
|
||||
video_info,
|
||||
&white_bg[0],
|
||||
mui->cursor_size,
|
||||
mui->textures.list[MUI_TEXTURE_POINTER],
|
||||
|
@ -797,7 +797,9 @@ static void xmb_render_keyboard(xmb_handle_t *xmb,
|
||||
1.00, 1.00, 1.00, 1.00,
|
||||
};
|
||||
|
||||
menu_display_draw_quad(0, height/2.0, width, height/2.0,
|
||||
menu_display_draw_quad(
|
||||
video_info,
|
||||
0, height/2.0, width, height/2.0,
|
||||
width, height,
|
||||
&dark[0]);
|
||||
|
||||
@ -815,7 +817,7 @@ static void xmb_render_keyboard(xmb_handle_t *xmb,
|
||||
{
|
||||
uintptr_t texture = xmb->textures.list[XMB_TEXTURE_KEY_HOVER];
|
||||
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
menu_display_draw_texture(
|
||||
width/2.0 - (11*ptr_width)/2.0 + (i % 11) * ptr_width,
|
||||
@ -825,7 +827,7 @@ static void xmb_render_keyboard(xmb_handle_t *xmb,
|
||||
&white[0],
|
||||
texture);
|
||||
|
||||
menu_display_blend_end();
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
|
||||
menu_display_draw_text(xmb->font, grid[i],
|
||||
@ -911,7 +913,7 @@ static void xmb_render_messagebox_internal(
|
||||
}
|
||||
}
|
||||
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
menu_display_draw_texture_slice(
|
||||
x - longest_width/2 - xmb->margins_dialog,
|
||||
@ -2642,7 +2644,7 @@ static void xmb_draw_items(
|
||||
|
||||
xmb_calculate_visible_range(xmb, height, end, current, &first, &last);
|
||||
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
for (i = first; i <= last; i++)
|
||||
{
|
||||
@ -2663,7 +2665,7 @@ static void xmb_draw_items(
|
||||
break;
|
||||
}
|
||||
|
||||
menu_display_blend_end();
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
|
||||
static void xmb_render(void *data, bool is_idle)
|
||||
@ -2768,7 +2770,7 @@ static void xmb_draw_bg(
|
||||
draw.pipeline.id = 0;
|
||||
draw.pipeline.active = xmb_shader_pipeline_active(video_info);
|
||||
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
menu_display_set_viewport(video_info->width, video_info->height);
|
||||
|
||||
#ifdef HAVE_SHADERPIPELINE
|
||||
@ -2844,11 +2846,12 @@ static void xmb_draw_bg(
|
||||
}
|
||||
|
||||
menu_display_draw(&draw);
|
||||
menu_display_blend_end();
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
|
||||
static void xmb_draw_dark_layer(
|
||||
xmb_handle_t *xmb,
|
||||
video_frame_info_t *video_info,
|
||||
unsigned width,
|
||||
unsigned height)
|
||||
{
|
||||
@ -2879,9 +2882,9 @@ static void xmb_draw_dark_layer(
|
||||
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP;
|
||||
draw.pipeline.id = 0;
|
||||
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
menu_display_draw(&draw);
|
||||
menu_display_blend_end();
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
|
||||
static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
@ -2972,7 +2975,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
rotate_draw.scale_enable = true;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw);
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
if (xmb->savestate_thumbnail)
|
||||
xmb_draw_thumbnail(menu_disp_info,
|
||||
@ -3125,7 +3128,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
&coord_white[0],
|
||||
xmb->shadow_offset);
|
||||
|
||||
menu_display_blend_begin();
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
/* Horizontal tab icons */
|
||||
for (i = 0; i <= xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL)
|
||||
@ -3176,7 +3179,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
}
|
||||
}
|
||||
|
||||
menu_display_blend_end();
|
||||
menu_display_blend_end(video_info);
|
||||
|
||||
/* Vertical icons */
|
||||
if (xmb)
|
||||
@ -3234,9 +3237,9 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
if (render_background)
|
||||
{
|
||||
xmb_draw_dark_layer(xmb, width, height);
|
||||
|
||||
xmb_render_messagebox_internal(menu_disp_info, video_info, xmb, msg, &coord_white[0]);
|
||||
xmb_draw_dark_layer(xmb, video_info, width, height);
|
||||
xmb_render_messagebox_internal(menu_disp_info,
|
||||
video_info, xmb, msg, &coord_white[0]);
|
||||
}
|
||||
|
||||
/* Cursor image */
|
||||
@ -3244,6 +3247,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
menu_display_set_alpha(coord_white, MIN(xmb->alpha, 1.00f));
|
||||
menu_display_draw_cursor(
|
||||
video_info,
|
||||
&coord_white[0],
|
||||
xmb->cursor_size,
|
||||
xmb->textures.list[XMB_TEXTURE_POINTER],
|
||||
|
@ -30,11 +30,11 @@ static void *menu_display_caca_get_default_mvp(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void menu_display_caca_blend_begin(void)
|
||||
static void menu_display_caca_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
static void menu_display_caca_blend_end(void)
|
||||
static void menu_display_caca_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -43,12 +43,12 @@ static void *menu_display_ctr_get_default_mvp(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void menu_display_ctr_blend_begin(void)
|
||||
static void menu_display_ctr_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void menu_display_ctr_blend_end(void)
|
||||
static void menu_display_ctr_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -78,9 +78,10 @@ static INT32 menu_display_prim_to_d3d_enum(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void menu_display_d3d_blend_begin(void)
|
||||
static void menu_display_d3d_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(false);
|
||||
d3d_video_t *d3d = video_info ?
|
||||
(d3d_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -88,9 +89,10 @@ static void menu_display_d3d_blend_begin(void)
|
||||
d3d_enable_blend_func(d3d->dev);
|
||||
}
|
||||
|
||||
static void menu_display_d3d_blend_end(void)
|
||||
static void menu_display_d3d_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(false);
|
||||
d3d_video_t *d3d = video_info ?
|
||||
(d3d_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
|
@ -34,16 +34,18 @@ static const float* menu_display_d3d11_get_default_tex_coords(void) { return NUL
|
||||
|
||||
static void* menu_display_d3d11_get_default_mvp(void) { return NULL; }
|
||||
|
||||
static void menu_display_d3d11_blend_begin(void)
|
||||
static void menu_display_d3d11_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d11_video_t* d3d11 = (d3d11_video_t*)video_driver_get_ptr(false);
|
||||
D3D11SetBlendState(d3d11->context, d3d11->blend_enable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
d3d11_video_t* d3d11 = video_info ? (d3d11_video_t*)video_info->userdata : NULL;
|
||||
D3D11SetBlendState(d3d11->context,
|
||||
d3d11->blend_enable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
}
|
||||
|
||||
static void menu_display_d3d11_blend_end(void)
|
||||
static void menu_display_d3d11_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d11_video_t* d3d11 = (d3d11_video_t*)video_driver_get_ptr(false);
|
||||
D3D11SetBlendState(d3d11->context, d3d11->blend_disable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
d3d11_video_t* d3d11 = video_info ? (d3d11_video_t*)video_info->userdata : NULL;
|
||||
D3D11SetBlendState(d3d11->context,
|
||||
d3d11->blend_disable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
}
|
||||
|
||||
static void menu_display_d3d11_viewport(void* data) {}
|
||||
|
@ -34,17 +34,17 @@ static const float* menu_display_d3d12_get_default_tex_coords(void) { return NUL
|
||||
|
||||
static void* menu_display_d3d12_get_default_mvp(void) { return NULL; }
|
||||
|
||||
static void menu_display_d3d12_blend_begin(void)
|
||||
static void menu_display_d3d12_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d12_video_t* d3d12 = (d3d12_video_t*)video_driver_get_ptr(false);
|
||||
d3d12_video_t* d3d12 = video_info ? (d3d12_video_t*)video_info->userdata : NULL;
|
||||
|
||||
d3d12->sprites.pipe = d3d12->sprites.pipe_blend;
|
||||
D3D12SetPipelineState(d3d12->queue.cmd, d3d12->sprites.pipe);
|
||||
}
|
||||
|
||||
static void menu_display_d3d12_blend_end(void)
|
||||
static void menu_display_d3d12_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d12_video_t* d3d12 = (d3d12_video_t*)video_driver_get_ptr(false);
|
||||
d3d12_video_t* d3d12 = video_info ? (d3d12_video_t*)video_info->userdata : NULL;
|
||||
|
||||
d3d12->sprites.pipe = d3d12->sprites.pipe_noblend;
|
||||
D3D12SetPipelineState(d3d12->queue.cmd, d3d12->sprites.pipe);
|
||||
|
@ -34,11 +34,11 @@ static void *menu_display_gdi_get_default_mvp(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void menu_display_gdi_blend_begin(void)
|
||||
static void menu_display_gdi_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
static void menu_display_gdi_blend_end(void)
|
||||
static void menu_display_gdi_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ static GLenum menu_display_prim_to_gl_enum(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void menu_display_gl_blend_begin(void)
|
||||
static void menu_display_gl_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
video_shader_ctx_info_t shader_info;
|
||||
|
||||
@ -91,7 +91,7 @@ static void menu_display_gl_blend_begin(void)
|
||||
video_shader_driver_use(shader_info);
|
||||
}
|
||||
|
||||
static void menu_display_gl_blend_end(void)
|
||||
static void menu_display_gl_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
@ -28,11 +28,11 @@ static void *menu_display_null_get_default_mvp(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void menu_display_null_blend_begin(void)
|
||||
static void menu_display_null_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
static void menu_display_null_blend_end(void)
|
||||
static void menu_display_null_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -30,11 +30,11 @@ static void *menu_display_vga_get_default_mvp(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void menu_display_vga_blend_begin(void)
|
||||
static void menu_display_vga_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
static void menu_display_vga_blend_end(void)
|
||||
static void menu_display_vga_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -82,12 +82,12 @@ static SceGxmPrimitiveType menu_display_prim_to_vita2d_enum(
|
||||
}
|
||||
#endif
|
||||
|
||||
static void menu_display_vita2d_blend_begin(void)
|
||||
static void menu_display_vita2d_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void menu_display_vita2d_blend_end(void)
|
||||
static void menu_display_vita2d_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -306,16 +306,20 @@ static void menu_display_vk_clear_color(
|
||||
vkCmdClearAttachments(vk->cmd, 1, &attachment, 1, &rect);
|
||||
}
|
||||
|
||||
static void menu_display_vk_blend_begin(void)
|
||||
static void menu_display_vk_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
vk_t *vk = (vk_t*)video_driver_get_ptr(false);
|
||||
vk->display.blend = true;
|
||||
vk_t *vk = video_info ? (vk_t*)video_info->userdata : NULL;
|
||||
|
||||
if (vk)
|
||||
vk->display.blend = true;
|
||||
}
|
||||
|
||||
static void menu_display_vk_blend_end(void)
|
||||
static void menu_display_vk_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
vk_t *vk = (vk_t*)video_driver_get_ptr(false);
|
||||
vk->display.blend = false;
|
||||
vk_t *vk = video_info ? (vk_t*)video_info->userdata : NULL;
|
||||
|
||||
if (vk)
|
||||
vk->display.blend = false;
|
||||
}
|
||||
|
||||
static bool menu_display_vk_font_init_first(
|
||||
|
@ -44,12 +44,12 @@ static void *menu_display_wiiu_get_default_mvp(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void menu_display_wiiu_blend_begin(void)
|
||||
static void menu_display_wiiu_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void menu_display_wiiu_blend_end(void)
|
||||
static void menu_display_wiiu_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -303,17 +303,17 @@ void menu_display_timedate(menu_display_ctx_datetime_t *datetime)
|
||||
}
|
||||
|
||||
/* Begin blending operation */
|
||||
void menu_display_blend_begin(void)
|
||||
void menu_display_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
if (menu_disp && menu_disp->blend_begin)
|
||||
menu_disp->blend_begin();
|
||||
menu_disp->blend_begin(video_info);
|
||||
}
|
||||
|
||||
/* End blending operation */
|
||||
void menu_display_blend_end(void)
|
||||
void menu_display_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
if (menu_disp && menu_disp->blend_end)
|
||||
menu_disp->blend_end();
|
||||
menu_disp->blend_end(video_info);
|
||||
}
|
||||
|
||||
/* Teardown; deinitializes and frees all
|
||||
@ -653,6 +653,7 @@ void menu_display_draw_gradient(menu_display_ctx_draw_t *draw,
|
||||
}
|
||||
|
||||
void menu_display_draw_quad(
|
||||
video_frame_info_t *video_info,
|
||||
int x, int y, unsigned w, unsigned h,
|
||||
unsigned width, unsigned height,
|
||||
float *color)
|
||||
@ -667,7 +668,7 @@ void menu_display_draw_quad(
|
||||
coords.color = color;
|
||||
|
||||
if (menu_disp && menu_disp->blend_begin)
|
||||
menu_disp->blend_begin();
|
||||
menu_disp->blend_begin(video_info);
|
||||
|
||||
draw.x = x;
|
||||
draw.y = (int)height - y - (int)h;
|
||||
@ -684,7 +685,7 @@ void menu_display_draw_quad(
|
||||
menu_display_draw(&draw);
|
||||
|
||||
if (menu_disp && menu_disp->blend_end)
|
||||
menu_disp->blend_end();
|
||||
menu_disp->blend_end(video_info);
|
||||
}
|
||||
|
||||
void menu_display_draw_texture(
|
||||
@ -1114,6 +1115,7 @@ void menu_display_allocate_white_texture(void)
|
||||
* Draw a hardware cursor on top of the screen for the mouse.
|
||||
*/
|
||||
void menu_display_draw_cursor(
|
||||
video_frame_info_t *video_info,
|
||||
float *color, float cursor_size, uintptr_t texture,
|
||||
float x, float y, unsigned width, unsigned height)
|
||||
{
|
||||
@ -1133,7 +1135,7 @@ void menu_display_draw_cursor(
|
||||
coords.color = (const float*)color;
|
||||
|
||||
if (menu_disp && menu_disp->blend_begin)
|
||||
menu_disp->blend_begin();
|
||||
menu_disp->blend_begin(video_info);
|
||||
|
||||
draw.x = x - (cursor_size / 2);
|
||||
draw.y = (int)height - y - (cursor_size / 2);
|
||||
@ -1148,7 +1150,7 @@ void menu_display_draw_cursor(
|
||||
menu_display_draw(&draw);
|
||||
|
||||
if (menu_disp && menu_disp->blend_end)
|
||||
menu_disp->blend_end();
|
||||
menu_disp->blend_end(video_info);
|
||||
}
|
||||
|
||||
static INLINE float menu_display_scalef(float val,
|
||||
|
@ -325,9 +325,9 @@ typedef struct menu_display_ctx_driver
|
||||
void (*draw_pipeline)(void *data);
|
||||
void (*viewport)(void *data);
|
||||
/* Start blending operation. */
|
||||
void (*blend_begin)(void);
|
||||
void (*blend_begin)(video_frame_info_t *video_info);
|
||||
/* Finish blending operation. */
|
||||
void (*blend_end)(void);
|
||||
void (*blend_end)(video_frame_info_t *video_info);
|
||||
/* Set the clear color back to its default values. */
|
||||
void (*restore_clear_color)(void);
|
||||
/* Set the color to be used when clearing the screen */
|
||||
@ -641,8 +641,8 @@ void menu_navigation_set_selection(size_t val);
|
||||
enum menu_toggle_reason menu_display_toggle_get_reason(void);
|
||||
void menu_display_toggle_set_reason(enum menu_toggle_reason reason);
|
||||
|
||||
void menu_display_blend_begin(void);
|
||||
void menu_display_blend_end(void);
|
||||
void menu_display_blend_begin(video_frame_info_t *video_info);
|
||||
void menu_display_blend_end(video_frame_info_t *video_info);
|
||||
|
||||
void menu_display_font_free(font_data_t *font);
|
||||
|
||||
@ -685,7 +685,9 @@ void menu_display_draw_bg(
|
||||
void menu_display_draw_gradient(
|
||||
menu_display_ctx_draw_t *draw,
|
||||
video_frame_info_t *video_info);
|
||||
void menu_display_draw_quad(int x, int y, unsigned w, unsigned h,
|
||||
void menu_display_draw_quad(
|
||||
video_frame_info_t *video_info,
|
||||
int x, int y, unsigned w, unsigned h,
|
||||
unsigned width, unsigned height,
|
||||
float *color);
|
||||
void menu_display_draw_texture(int x, int y, unsigned w, unsigned h,
|
||||
@ -718,6 +720,7 @@ void menu_display_snow(int width, int height);
|
||||
void menu_display_allocate_white_texture(void);
|
||||
|
||||
void menu_display_draw_cursor(
|
||||
video_frame_info_t *video_info,
|
||||
float *color, float cursor_size, uintptr_t texture,
|
||||
float x, float y, unsigned width, unsigned height);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user