From c8bc6c7120c4a5291b03ed175584edb208f19e34 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 8 Jan 2017 03:56:47 +0100 Subject: [PATCH] (XMB) Add Bokeh menu pipeline --- gfx/drivers_shader/shader_glsl.c | 15 +++++++++++++++ gfx/video_shader_driver.h | 1 + intl/msg_hash_de.h | 2 ++ intl/msg_hash_eo.h | 2 ++ intl/msg_hash_fr.h | 2 ++ intl/msg_hash_ja.h | 2 ++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 2 ++ intl/msg_hash_ru.h | 2 ++ intl/msg_hash_us.h | 2 ++ menu/cbs/menu_cbs_get_value.c | 5 +++++ menu/drivers/xmb.c | 3 +++ menu/drivers_display/menu_display_gl.c | 2 ++ menu/drivers_display/menu_display_vulkan.c | 1 + menu/menu_display.h | 1 + msg_hash.h | 1 + 16 files changed, 45 insertions(+) diff --git a/gfx/drivers_shader/shader_glsl.c b/gfx/drivers_shader/shader_glsl.c index 7ea6acabd2..cec9055b99 100644 --- a/gfx/drivers_shader/shader_glsl.c +++ b/gfx/drivers_shader/shader_glsl.c @@ -1002,6 +1002,21 @@ static void *gl_glsl_init(void *data, const char *path) &shader_prog_info); gl_glsl_find_uniforms(glsl, 0, glsl->prg[VIDEO_SHADER_MENU_4].id, &glsl->uniforms[VIDEO_SHADER_MENU_4]); + +#if defined(HAVE_OPENGLES) + shader_prog_info.vertex = stock_vertex_xmb_snow_modern; +#else + shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_modern : stock_vertex_xmb_snow_legacy; +#endif + shader_prog_info.fragment = stock_fragment_xmb_bokeh; + + gl_glsl_compile_program( + glsl, + VIDEO_SHADER_MENU_5, + &glsl->prg[VIDEO_SHADER_MENU_5], + &shader_prog_info); + gl_glsl_find_uniforms(glsl, 0, glsl->prg[VIDEO_SHADER_MENU_5].id, + &glsl->uniforms[VIDEO_SHADER_MENU_5]); #endif gl_glsl_reset_attrib(glsl); diff --git a/gfx/video_shader_driver.h b/gfx/video_shader_driver.h index ed9ab8afcb..5207777911 100644 --- a/gfx/video_shader_driver.h +++ b/gfx/video_shader_driver.h @@ -39,6 +39,7 @@ #define VIDEO_SHADER_MENU_2 (GFX_MAX_SHADERS - 3) #define VIDEO_SHADER_MENU_3 (GFX_MAX_SHADERS - 4) #define VIDEO_SHADER_MENU_4 (GFX_MAX_SHADERS - 5) +#define VIDEO_SHADER_MENU_5 (GFX_MAX_SHADERS - 6) #endif diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index fa03848c7a..f2d8f14494 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -898,3 +898,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_BROWSE_START, "Start" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH, + "Bokeh") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 6ad426493f..bf8b767526 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2259,3 +2259,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_BROWSE_START, "Start" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH, + "Bokeh") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 9f035e57cd..8f1c39fece 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -2225,3 +2225,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_BROWSE_START, "Start" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH, + "Bokeh") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index d43686b56d..318c38601e 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -2380,3 +2380,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_BROWSE_START, "Start" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH, + "Bokeh") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 62e9989d1a..b223e9fa33 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1179,3 +1179,5 @@ MSG_HASH(MENU_ENUM_LABEL_BROWSE_URL, "browse_url") MSG_HASH(MENU_ENUM_LABEL_BROWSE_START, "browse_start") +MSG_HASH(MENU_ENUM_LABEL_SHADER_PIPELINE_BOKEH, + "shader_pipeline_bokeh") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index f2b4775dff..feb0cb7f92 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2259,3 +2259,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_BROWSE_START, "Start" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH, + "Bokeh") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 20db1f7728..ab6c0746b0 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -2258,3 +2258,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_BROWSE_START, "Start" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH, + "Bokeh") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 4d8c16437a..ac90b1aae4 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -2377,3 +2377,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_BROWSE_START, "Start" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH, + "Bokeh") diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 6164596e6c..af27a674d9 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -235,6 +235,11 @@ static void menu_action_setting_disp_set_label_pipeline( msg_hash_to_str( MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_SNOW), len); break; + case XMB_SHADER_PIPELINE_BOKEH: + strlcpy(s, + msg_hash_to_str( + MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH), len); + break; } strlcpy(s2, path, len2); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index b165b1cc60..fa13b5d18e 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2453,6 +2453,9 @@ static void xmb_draw_bg( case XMB_SHADER_PIPELINE_SNOW: draw.pipeline.id = VIDEO_SHADER_MENU_4; break; + case XMB_SHADER_PIPELINE_BOKEH: + draw.pipeline.id = VIDEO_SHADER_MENU_5; + break; default: break; } diff --git a/menu/drivers_display/menu_display_gl.c b/menu/drivers_display/menu_display_gl.c index c5fdeda4e2..997bc6f5f9 100644 --- a/menu/drivers_display/menu_display_gl.c +++ b/menu/drivers_display/menu_display_gl.c @@ -174,6 +174,7 @@ static void menu_display_gl_draw_pipeline(void *data) case VIDEO_SHADER_MENU_2: case VIDEO_SHADER_MENU_3: case VIDEO_SHADER_MENU_4: + case VIDEO_SHADER_MENU_5: shader_info.data = NULL; shader_info.idx = draw->pipeline.id; shader_info.set_active = true; @@ -203,6 +204,7 @@ static void menu_display_gl_draw_pipeline(void *data) { case VIDEO_SHADER_MENU_3: case VIDEO_SHADER_MENU_4: + case VIDEO_SHADER_MENU_5: #ifndef HAVE_PSGL uniform_param.type = UNIFORM_2F; uniform_param.lookup.ident = "OutputSize"; diff --git a/menu/drivers_display/menu_display_vulkan.c b/menu/drivers_display/menu_display_vulkan.c index f4d083663b..4ff563f005 100644 --- a/menu/drivers_display/menu_display_vulkan.c +++ b/menu/drivers_display/menu_display_vulkan.c @@ -176,6 +176,7 @@ static void menu_display_vk_draw(void *data) case VIDEO_SHADER_MENU_2: case VIDEO_SHADER_MENU_3: case VIDEO_SHADER_MENU_4: + case VIDEO_SHADER_MENU_5: { const struct vk_draw_triangles call = { vk->display.pipelines[ diff --git a/menu/menu_display.h b/menu/menu_display.h index 2db2997c84..9f96910226 100644 --- a/menu/menu_display.h +++ b/menu/menu_display.h @@ -76,6 +76,7 @@ enum xmb_shader_pipeline XMB_SHADER_PIPELINE_RIBBON, XMB_SHADER_PIPELINE_SIMPLE_SNOW, XMB_SHADER_PIPELINE_SNOW, + XMB_SHADER_PIPELINE_BOKEH, XMB_SHADER_PIPELINE_LAST }; diff --git a/msg_hash.h b/msg_hash.h index 4f9e4d37c6..863c19246d 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -408,6 +408,7 @@ enum msg_hash_enums MENU_LABEL(SHADER_PIPELINE_RIBBON), MENU_LABEL(SHADER_PIPELINE_SIMPLE_SNOW), MENU_LABEL(SHADER_PIPELINE_SNOW), + MENU_LABEL(SHADER_PIPELINE_BOKEH), MENU_LABEL(MATERIALUI_MENU_HEADER_OPACITY), MENU_LABEL(MATERIALUI_MENU_FOOTER_OPACITY),