Kill off set_fbo_state and get_fbo_state function pointers

This commit is contained in:
twinaphex 2013-04-06 06:21:11 +02:00
parent f94ddb2eab
commit a2d9129782
7 changed files with 13 additions and 133 deletions

View File

@ -324,8 +324,6 @@ typedef struct video_poke_interface
void (*set_blend)(void *data, bool enable);
void (*set_filtering)(void *data, unsigned index, bool smooth);
#ifdef HAVE_FBO
void (*set_fbo_state)(void *data, unsigned state);
unsigned (*get_fbo_state)(void *data);
uintptr_t (*get_current_framebuffer)(void *data);
retro_proc_address_t (*get_proc_address)(void *data, const char *sym);
#endif

View File

@ -1059,15 +1059,6 @@ static int select_file(uint8_t menu_type, uint64_t input)
break;
case PRESET_CHOICE:
strlcpy(g_extern.file_state.cgp_path, path, sizeof(g_extern.file_state.cgp_path));
if (driver.video_poke->set_fbo_state)
driver.video_poke->set_fbo_state(driver.video_data, FBO_DEINIT);
#ifdef HAVE_OPENGL
gl_cg_reinit(path);
#endif
if (driver.video_poke->set_fbo_state)
driver.video_poke->set_fbo_state(driver.video_data, FBO_INIT);
break;
#endif
case INPUT_PRESET_CHOICE:

View File

@ -29,15 +29,6 @@
#define MAX_EGLIMAGE_TEXTURES 32
#ifdef HAVE_FBO
enum fbo_option
{
FBO_DEINIT = 0,
FBO_INIT,
FBO_REINIT
};
#endif
enum gfx_ctx_api
{
GFX_CTX_OPENGL_API,

View File

@ -2440,30 +2440,6 @@ static void gl_set_filtering(void *data, unsigned index, bool smooth)
}
#ifdef HAVE_FBO
static void gl_set_fbo_state(void *data, unsigned mode)
{
gl_t *gl = (gl_t*)data;
switch (mode)
{
case FBO_DEINIT:
gl_deinit_fbo(gl);
break;
case FBO_REINIT:
gl_deinit_fbo(gl);
// Fallthrough
case FBO_INIT:
gl_init_fbo(gl, gl->tex_w, gl->tex_h);
break;
}
}
static unsigned gl_get_fbo_state(void *data)
{
gl_t *gl = (gl_t*)data;
return gl->fbo_inited ? FBO_INIT : FBO_DEINIT;
}
static uintptr_t gl_get_current_framebuffer(void *data)
{
gl_t *gl = (gl_t*)data;
@ -2538,8 +2514,6 @@ static const video_poke_interface_t gl_poke_interface = {
gl_set_blend,
gl_set_filtering,
#ifdef HAVE_FBO
gl_set_fbo_state,
gl_get_fbo_state,
gl_get_current_framebuffer,
gl_get_proc_address,
#endif

View File

@ -264,21 +264,8 @@ static bool load_plain(const char *path)
prg[1] = prg[0];
}
if (*g_settings.video.second_pass_shader && g_settings.video.render_to_texture)
{
if (!load_program(2, g_settings.video.second_pass_shader, true))
{
RARCH_ERR("Failed to load HLSL shader %s into secondpass.\n", path);
prg[2] = prg[0];
}
hlsl_shader_num = 2;
}
else
{
prg[2] = prg[0];
hlsl_shader_num = 1;
}
prg[1] = prg[0];
hlsl_shader_num = 1;
return true;
}
@ -367,4 +354,4 @@ void hlsl_deinit(void)
return;
hlsl_deinit_state();
}
}

View File

@ -280,19 +280,6 @@ static void thread_loop(void *data)
thread_reply(thr, CMD_POKE_SET_FILTERING);
break;
#ifdef HAVE_FBO
case CMD_POKE_SET_FBO_STATE:
thr->poke->set_fbo_state(thr->driver_data,
thr->cmd_data.i);
thread_reply(thr, CMD_POKE_SET_FBO_STATE);
break;
case CMD_POKE_GET_FBO_STATE:
thr->cmd_data.i = thr->poke->get_fbo_state(thr->driver_data);
thread_reply(thr, CMD_POKE_GET_FBO_STATE);
break;
#endif
case CMD_POKE_SET_ASPECT_RATIO:
thr->poke->set_aspect_ratio(thr->driver_data,
thr->cmd_data.i);
@ -627,24 +614,6 @@ static void thread_set_filtering(void *data, unsigned index, bool smooth)
thread_wait_reply(thr, CMD_POKE_SET_FILTERING);
}
#ifdef HAVE_FBO
static void thread_set_fbo_state(void *data, unsigned state)
{
thread_video_t *thr = (thread_video_t*)data;
thr->cmd_data.i = state;
thread_send_cmd(thr, CMD_POKE_SET_FBO_STATE);
thread_wait_reply(thr, CMD_POKE_SET_FBO_STATE);
}
static unsigned thread_get_fbo_state(void *data)
{
thread_video_t *thr = (thread_video_t*)data;
thread_send_cmd(thr, CMD_POKE_GET_FBO_STATE);
thread_wait_reply(thr, CMD_POKE_GET_FBO_STATE);
return thr->cmd_data.i;
}
#endif
static void thread_set_aspect_ratio(void *data, unsigned aspectratio_index)
{
thread_video_t *thr = (thread_video_t*)data;
@ -676,8 +645,6 @@ static const video_poke_interface_t thread_poke = {
thread_set_blend,
thread_set_filtering,
#ifdef HAVE_FBO
thread_set_fbo_state,
thread_get_fbo_state,
NULL,
NULL,
#endif

View File

@ -322,6 +322,7 @@ static void xdk_d3d_set_rotation(void *data, unsigned orientation)
#ifdef HAVE_FBO
void xdk_d3d_deinit_fbo(void *data)
{
#if 0
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
if (d3d->fbo_inited)
@ -341,6 +342,7 @@ void xdk_d3d_deinit_fbo(void *data)
d3d->fbo_inited = false;
}
#endif
}
void xdk_d3d_init_fbo(void *data)
@ -348,9 +350,7 @@ void xdk_d3d_init_fbo(void *data)
HRESULT ret;
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
if (!g_settings.video.render_to_texture)
return;
#if 0
xdk_d3d_deinit_fbo(d3d);
ret = d3d->d3d_render_device->CreateTexture(d3d->tex_w * g_settings.video.fbo.scale_x, d3d->tex_h * g_settings.video.fbo.scale_y,
@ -378,8 +378,8 @@ void xdk_d3d_init_fbo(void *data)
xdk_convert_texture_to_as16_srgb(&d3d->lpTexture_ot_as16srgb);
d3d->fbo_inited = true;
}
#endif
}
static bool xdk_d3d_set_shader(void *data, enum rarch_shader_type type, const char *path, unsigned index)
{
@ -574,7 +574,7 @@ static void xdk_d3d_reinit_textures(void *data, const video_info_t *video)
xdk_d3d_init_textures(d3d, video);
#ifdef HAVE_FBO
#if 0 /* ifdef HAVE_FBO */
if (d3d->tex_w > old_width || d3d->tex_h > old_height)
{
RARCH_LOG("Reiniting FBO.\n");
@ -726,7 +726,7 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu
RARCH_LOG("D3D: Loaded %u program(s).\n", d3d_hlsl_num());
#endif
#ifdef HAVE_FBO
#if 0 /* ifdef HAVE_FBO */
xdk_d3d_init_fbo(d3d);
#endif
@ -816,7 +816,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->d3d_render_device;
uint64_t lifecycle_mode_state = g_extern.lifecycle_mode_state;
#ifdef HAVE_FBO
#if 0 /* ifdef HAVE_FBO */
D3DSurface* pRenderTarget0;
#endif
@ -872,7 +872,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
d3d->last_height = height;
}
#ifdef HAVE_FBO
#if 0 /* ifdef HAVE_FBO */
if (d3d->fbo_inited)
{
d3dr->GetRenderTarget(0, &pRenderTarget0);
@ -889,7 +889,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
hlsl_use(1);
#endif
#ifdef HAVE_FBO
#if 0 /* ifdef HAVE_FBO */
if (d3d->fbo_inited)
{
#ifdef HAVE_HLSL
@ -948,7 +948,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
#endif
d3dr->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
#ifdef HAVE_FBO
#if 0 /* ifdef HAVE_FBO */
if (d3d->fbo_inited)
{
d3dr->Resolve(D3DRESOLVE_RENDERTARGET0, NULL, d3d->lpTexture_ot,
@ -1095,30 +1095,6 @@ static void xdk_d3d_apply_state_changes(void *data)
d3d->should_resize = true;
}
#ifdef HAVE_FBO
static unsigned xdk_d3d_get_fbo_state(void *data)
{
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
return d3d->fbo_inited ? FBO_INIT : FBO_DEINIT;
}
static void xdk_d3d_set_fbo_state(void *data, unsigned mode)
{
xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)data;
switch(mode)
{
case FBO_DEINIT:
xdk_d3d_deinit_fbo(device_ptr);
break;
case FBO_REINIT:
case FBO_INIT:
xdk_d3d_init_fbo(device_ptr);
break;
}
}
#endif
#ifdef HAVE_RGUI
static void xdk_d3d_set_rgui_texture(void *data, const void *frame)
{
@ -1139,10 +1115,6 @@ static void xdk_d3d_set_osd_msg(void *data, const char *msg, void *userdata)
static const video_poke_interface_t d3d_poke_interface = {
xdk_d3d_set_blend,
xdk_d3d_set_filtering,
#ifdef HAVE_FBO
xdk_d3d_set_fbo_state,
xdk_d3d_get_fbo_state,
#endif
xdk_d3d_set_aspect_ratio,
xdk_d3d_apply_state_changes,
#ifdef HAVE_RGUI