mirror of
https://github.com/libretro/RetroArch
synced 2025-02-25 21:41:03 +00:00
(PS3) Use new set swap block callback
This commit is contained in:
parent
761f5d7a5c
commit
a03dd57166
@ -1994,6 +1994,8 @@ void menu_loop(void)
|
||||
|
||||
g_console.menu_enable = true;
|
||||
|
||||
gl_t * gl = g_gl;
|
||||
|
||||
menu_reinit_settings();
|
||||
|
||||
if(g_console.ingame_menu_enable)
|
||||
@ -2001,7 +2003,7 @@ void menu_loop(void)
|
||||
menuStackindex++;
|
||||
menuStack[menuStackindex] = menu_filebrowser;
|
||||
menuStack[menuStackindex].enum_id = INGAME_MENU;
|
||||
ps3graphics_block_swap();
|
||||
video_gl.set_swap_block_state(NULL, true);
|
||||
}
|
||||
|
||||
do
|
||||
@ -2059,7 +2061,7 @@ void menu_loop(void)
|
||||
if(g_console.ingame_menu_enable)
|
||||
{
|
||||
menuStackindex--; // pop ingame menu from stack
|
||||
ps3graphics_unblock_swap();
|
||||
video_gl.set_swap_block_state(NULL, false);
|
||||
}
|
||||
|
||||
g_console.ingame_menu_enable = false;
|
||||
|
@ -37,7 +37,6 @@
|
||||
|
||||
#include "../strl.h"
|
||||
|
||||
#include "../gfx/image.h"
|
||||
#include "../gfx/shader_cg.h"
|
||||
|
||||
#define BLUE 0xffff0000u
|
||||
@ -98,61 +97,10 @@ static const GLfloat white_color[] = {
|
||||
1, 1, 1, 1,
|
||||
};
|
||||
|
||||
|
||||
static bool load_fbo_proc(void) { return true; }
|
||||
|
||||
#define MAX_SHADERS 16
|
||||
|
||||
#define TEXTURES 8
|
||||
#define TEXTURES_MASK (TEXTURES - 1)
|
||||
|
||||
bool g_quitting;
|
||||
unsigned g_frame_count;
|
||||
void *g_gl;
|
||||
|
||||
|
||||
typedef struct gl
|
||||
{
|
||||
bool block_swap;
|
||||
bool fbo_inited;
|
||||
bool keep_aspect;
|
||||
bool render_to_tex;
|
||||
bool should_resize;
|
||||
bool vsync;
|
||||
bool overscan_enable;
|
||||
int fbo_pass;
|
||||
unsigned base_size; /* 2 or 4*/
|
||||
unsigned last_width[TEXTURES];
|
||||
unsigned last_height[TEXTURES];
|
||||
unsigned tex_index; /* For use with PREV. */
|
||||
unsigned tex_w, tex_h;
|
||||
unsigned vp_width, vp_out_width;
|
||||
unsigned vp_height, vp_out_height;
|
||||
unsigned win_width;
|
||||
unsigned win_height;
|
||||
GLfloat overscan_amount;
|
||||
GLfloat tex_coords[8];
|
||||
GLfloat fbo_tex_coords[8];
|
||||
GLenum texture_type; /* XBGR1555 or ARGB*/
|
||||
GLenum texture_fmt;
|
||||
/* Render-to-texture, multipass shaders */
|
||||
GLuint fbo[MAX_SHADERS];
|
||||
GLuint fbo_texture[MAX_SHADERS];
|
||||
GLuint menu_texture_id;
|
||||
GLuint pbo;
|
||||
GLuint texture[TEXTURES];
|
||||
GLuint tex_filter;
|
||||
CellVideoOutState g_video_state;
|
||||
PSGLdevice* gl_device;
|
||||
PSGLcontext* gl_context;
|
||||
struct gl_fbo_rect fbo_rect[MAX_SHADERS];
|
||||
struct gl_fbo_scale fbo_scale[MAX_SHADERS];
|
||||
struct gl_tex_info prev_info[TEXTURES];
|
||||
struct texture_image menu_texture;
|
||||
void *empty_buf;
|
||||
} gl_t;
|
||||
|
||||
|
||||
static bool gl_shader_init(void)
|
||||
{
|
||||
switch (g_settings.video.shader_type)
|
||||
@ -276,12 +224,6 @@ static void gl_init_fbo(gl_t *gl, unsigned width, unsigned height)
|
||||
if (gl_shader_num() == 1 && !scale.valid && !g_settings.video.render_to_texture)
|
||||
return;
|
||||
|
||||
if (!load_fbo_proc())
|
||||
{
|
||||
SSNES_ERR("Failed to locate FBO functions. Won't be able to use render-to-texture.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
gl->fbo_pass = gl_shader_num() - 1;
|
||||
if (scale_last.valid)
|
||||
gl->fbo_pass++;
|
||||
@ -1117,6 +1059,18 @@ static bool gl_focus(void *data)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ps3graphics_set_swap_block_swap(void * data, bool toggle)
|
||||
{
|
||||
(void)data;
|
||||
gl_t *gl = g_gl;
|
||||
gl->block_swap = toggle;
|
||||
|
||||
if(toggle)
|
||||
SSNES_LOG("Swap is set to blocked\n");
|
||||
else
|
||||
SSNES_LOG("Swap is set to non-blocked\n");
|
||||
}
|
||||
|
||||
const video_driver_t video_gl = {
|
||||
.init = gl_init,
|
||||
.frame = gl_frame,
|
||||
@ -1124,7 +1078,8 @@ const video_driver_t video_gl = {
|
||||
.set_nonblock_state = gl_set_nonblock_state,
|
||||
.focus = gl_focus,
|
||||
.free = gl_free,
|
||||
.ident = "gl"
|
||||
.ident = "gl",
|
||||
.set_swap_block_state = ps3graphics_set_swap_block_swap
|
||||
};
|
||||
|
||||
static void get_all_available_resolutions (void)
|
||||
@ -1227,19 +1182,6 @@ const char * ps3_get_resolution_label(uint32_t resolution)
|
||||
}
|
||||
}
|
||||
|
||||
void ps3graphics_block_swap (void)
|
||||
{
|
||||
gl_t *gl = g_gl;
|
||||
gl->block_swap = true;
|
||||
SSNES_LOG("Swap is set to blocked\n");
|
||||
}
|
||||
|
||||
void ps3graphics_unblock_swap (void)
|
||||
{
|
||||
gl_t *gl = g_gl;
|
||||
gl->block_swap = false;
|
||||
SSNES_LOG("Swap is set to non-blocked\n");
|
||||
}
|
||||
|
||||
void ps3graphics_set_vsync(uint32_t vsync)
|
||||
{
|
||||
|
@ -21,8 +21,14 @@
|
||||
|
||||
#include "../gfx/gl_common.h"
|
||||
#include "../gfx/gfx_common.h"
|
||||
#include "../gfx/image.h"
|
||||
#include <cell/dbgfont.h>
|
||||
|
||||
#define MAX_SHADERS 16
|
||||
|
||||
#define TEXTURES 8
|
||||
#define TEXTURES_MASK (TEXTURES - 1)
|
||||
|
||||
enum
|
||||
{
|
||||
ASPECT_RATIO_4_3,
|
||||
@ -41,6 +47,47 @@ enum
|
||||
LAST_ASPECT_RATIO
|
||||
};
|
||||
|
||||
typedef struct gl
|
||||
{
|
||||
bool block_swap;
|
||||
bool fbo_inited;
|
||||
bool keep_aspect;
|
||||
bool render_to_tex;
|
||||
bool should_resize;
|
||||
bool vsync;
|
||||
bool overscan_enable;
|
||||
int fbo_pass;
|
||||
unsigned base_size; /* 2 or 4*/
|
||||
unsigned last_width[TEXTURES];
|
||||
unsigned last_height[TEXTURES];
|
||||
unsigned tex_index; /* For use with PREV. */
|
||||
unsigned tex_w, tex_h;
|
||||
unsigned vp_width, vp_out_width;
|
||||
unsigned vp_height, vp_out_height;
|
||||
unsigned win_width;
|
||||
unsigned win_height;
|
||||
GLfloat overscan_amount;
|
||||
GLfloat tex_coords[8];
|
||||
GLfloat fbo_tex_coords[8];
|
||||
GLenum texture_type; /* XBGR1555 or ARGB*/
|
||||
GLenum texture_fmt;
|
||||
/* Render-to-texture, multipass shaders */
|
||||
GLuint fbo[MAX_SHADERS];
|
||||
GLuint fbo_texture[MAX_SHADERS];
|
||||
GLuint menu_texture_id;
|
||||
GLuint pbo;
|
||||
GLuint texture[TEXTURES];
|
||||
GLuint tex_filter;
|
||||
CellVideoOutState g_video_state;
|
||||
PSGLdevice* gl_device;
|
||||
PSGLcontext* gl_context;
|
||||
struct gl_fbo_rect fbo_rect[MAX_SHADERS];
|
||||
struct gl_fbo_scale fbo_scale[MAX_SHADERS];
|
||||
struct gl_tex_info prev_info[TEXTURES];
|
||||
struct texture_image menu_texture;
|
||||
void *empty_buf;
|
||||
} gl_t;
|
||||
|
||||
#define IS_TIMER_NOT_EXPIRED() (g_frame_count < g_console.timer_expiration_frame_count)
|
||||
#define IS_TIMER_EXPIRED() (!(IS_TIMER_NOT_EXPIRED()))
|
||||
#define SET_TIMER_EXPIRATION(value) g_console.timer_expiration_frame_count = g_frame_count + value;
|
||||
@ -53,13 +100,11 @@ void ps3_previous_resolution (void);
|
||||
void ps3_next_resolution (void);
|
||||
void ps3_set_filtering(unsigned index, bool set_smooth);
|
||||
void ps3_video_deinit(void);
|
||||
void ps3graphics_block_swap (void);
|
||||
void ps3graphics_reinit_fbos (void);
|
||||
void ps3graphics_set_aspect_ratio(uint32_t aspectratio_index);
|
||||
void ps3graphics_set_overscan(bool overscan_enable, float amount, bool recalculate_viewport);
|
||||
void ps3graphics_set_orientation(uint32_t orientation);
|
||||
void ps3graphics_set_vsync(uint32_t vsync);
|
||||
void ps3graphics_unblock_swap (void);
|
||||
void ps3graphics_video_init(bool get_all_resolutions);
|
||||
void ps3graphics_video_reinit(void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user