Merge pull request #2384 from aliaspider/master

allow using video filters when building with HAVE_FILTERS_BUILTIN
This commit is contained in:
Twinaphex 2015-11-12 15:45:46 +01:00
commit 663286472a
5 changed files with 19 additions and 11 deletions

View File

@ -75,6 +75,8 @@ static void frontend_ctr_get_environment_settings(int *argc, char *argv[],
"playlists", sizeof(g_defaults.dir.playlist));
fill_pathname_join(g_defaults.dir.remap, g_defaults.dir.port,
"remaps", sizeof(g_defaults.dir.remap));
fill_pathname_join(g_defaults.dir.video_filter, g_defaults.dir.port,
"filters", sizeof(g_defaults.dir.remap));
fill_pathname_join(g_defaults.path.config, g_defaults.dir.port,
"retroarch.cfg", sizeof(g_defaults.path.config));

View File

@ -536,7 +536,8 @@ static bool ctr_frame(void* data, const void* frame,
{
if(((((u32)(frame)) >= 0x14000000 && ((u32)(frame)) < 0x40000000)) /* frame in linear memory */
&& !((u32)frame & 0x7F) /* 128-byte aligned */
&& !((pitch) & 0xF)) /* 16-byte aligned */
&& !(pitch & 0xF) /* 16-byte aligned */
&& (pitch > 0x40))
{
/* can copy the buffer directly with the GPU */
ctrGuCopyImage(false, frame, pitch / (ctr->rgb32? 4: 2), height, ctr->rgb32 ? CTRGU_RGBA8: CTRGU_RGB565, false,
@ -562,6 +563,12 @@ static bool ctr_frame(void* data, const void* frame,
}
ctr->frame_coords->u = width;
ctr->frame_coords->v = height;
GSPGPU_FlushDataCache(ctr->frame_coords, sizeof(ctr_vertex_t));
ctrGuSetAttributeBuffersAddress(VIRT_TO_PHYS(ctr->frame_coords));
ctrGuSetVertexShaderFloatUniform(0, (float*)&ctr->scale_vector, 1);
}
ctrGuSetTexture(GPU_TEXUNIT0, VIRT_TO_PHYS(ctr->texture_swizzled), ctr->texture_width, ctr->texture_height,
@ -570,13 +577,6 @@ static bool ctr_frame(void* data, const void* frame,
GPU_TEXTURE_WRAP_S(GPU_CLAMP_TO_EDGE) | GPU_TEXTURE_WRAP_T(GPU_CLAMP_TO_EDGE),
ctr->rgb32 ? GPU_RGBA8: GPU_RGB565);
ctr->frame_coords->u = width;
ctr->frame_coords->v = height;
GSPGPU_FlushDataCache(ctr->frame_coords, sizeof(ctr_vertex_t));
ctrGuSetAttributeBuffersAddress(VIRT_TO_PHYS(ctr->frame_coords));
ctrGuSetVertexShaderFloatUniform(0, (float*)&ctr->scale_vector, 1);
/* ARGB --> RGBA */
if (ctr->rgb32)
{

View File

@ -285,7 +285,11 @@ bool video_driver_set_shader(enum rarch_shader_type type,
static void deinit_video_filter(void)
{
rarch_softfilter_free(video_state.filter.filter);
#ifdef _3DS
linearFree(video_state.filter.buffer);
#else
free(video_state.filter.buffer);
#endif
memset(&video_state.filter, 0, sizeof(video_state.filter));
}
@ -344,7 +348,11 @@ static void init_video_filter(enum retro_pixel_format colfmt)
sizeof(uint32_t) : sizeof(uint16_t);
/* TODO: Aligned output. */
#ifdef _3DS
video_state.filter.buffer = linearMemAlign(width * height * video_state.filter.out_bpp, 0x80);
#else
video_state.filter.buffer = malloc(width * height * video_state.filter.out_bpp);
#endif
if (!video_state.filter.buffer)
goto error;

View File

@ -216,6 +216,7 @@ static bool create_softfilter_graph(rarch_softfilter_t *filt,
return false;
}
filt->threads = threads;
RARCH_LOG("Using %u threads for softfilter.\n", threads);
filt->packets = (struct softfilter_work_packet*)
@ -231,7 +232,6 @@ static bool create_softfilter_graph(rarch_softfilter_t *filt,
calloc(threads, sizeof(*filt->thread_data));
if (!filt->thread_data)
return false;
filt->threads = threads;
for (i = 0; i < threads; i++)
{

View File

@ -4515,7 +4515,6 @@ static bool setting_append_list_video_options(
EVENT_CMD_VIDEO_APPLY_STATE_CHANGES);
#endif
#ifndef HAVE_FILTERS_BUILTIN
CONFIG_PATH(
settings->video.softfilter_plugin,
menu_hash_to_str(MENU_LABEL_VIDEO_FILTER),
@ -4529,7 +4528,6 @@ static bool setting_append_list_video_options(
menu_settings_list_current_add_values(list, list_info, "filt");
menu_settings_list_current_add_cmd(list, list_info, EVENT_CMD_REINIT);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_EMPTY);
#endif
#ifdef _XBOX1
CONFIG_UINT(