Android: Add the advanced graphics settings to the GUI

This commit is contained in:
JosJuice 2021-10-04 22:12:07 +02:00
parent 33ffc7aa66
commit 800bed330a
5 changed files with 126 additions and 26 deletions

View File

@ -129,18 +129,37 @@ public enum BooleanSetting implements AbstractBooleanSetting
SYSCONF_SCREENSAVER(Settings.FILE_SYSCONF, "IPL", "SSV", false),
SYSCONF_WIDESCREEN(Settings.FILE_SYSCONF, "IPL", "AR", true),
SYSCONF_PROGRESSIVE_SCAN(Settings.FILE_SYSCONF, "IPL", "PGS", true),
SYSCONF_PAL60(Settings.FILE_SYSCONF, "IPL", "E60", true),
SYSCONF_WIIMOTE_MOTOR(Settings.FILE_SYSCONF, "BT", "MOT", true),
GFX_WIDESCREEN_HACK(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "wideScreenHack", false),
GFX_CROP(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "Crop", false),
GFX_SHOW_FPS(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "ShowFPS", false),
GFX_OVERLAY_STATS(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "OverlayStats", false),
GFX_DUMP_TEXTURES(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "DumpTextures", false),
GFX_DUMP_MIP_TEXTURES(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "DumpMipTextures", false),
GFX_DUMP_BASE_TEXTURES(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "DumpBaseTextures",
false),
GFX_HIRES_TEXTURES(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "HiresTextures", false),
GFX_CACHE_HIRES_TEXTURES(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "CacheHiresTextures",
false),
GFX_DUMP_EFB_TARGET(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "DumpEFBTarget", false),
GFX_DUMP_XFB_TARGET(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "DumpXFBTarget", false),
GFX_INTERNAL_RESOLUTION_FRAME_DUMPS(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS,
"InternalResolutionFrameDumps", false),
GFX_ENABLE_GPU_TEXTURE_DECODING(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS,
"EnableGPUTextureDecoding", false),
GFX_ENABLE_PIXEL_LIGHTING(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS,
"EnablePixelLighting", false),
GFX_FAST_DEPTH_CALC(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "FastDepthCalc", true),
GFX_TEXFMT_OVERLAY_ENABLE(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "TexFmtOverlayEnable",
false),
GFX_ENABLE_WIREFRAME(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "WireFrame", false),
GFX_DISABLE_FOG(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "DisableFog", false),
GFX_ENABLE_VALIDATION_LAYER(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS,
"EnableValidationLayer", false),
GFX_BACKEND_MULTITHREADING(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS,
"BackendMultithreading", false),
GFX_WAIT_FOR_SHADERS_BEFORE_STARTING(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS,
@ -161,11 +180,15 @@ public enum BooleanSetting implements AbstractBooleanSetting
GFX_HACK_EFB_ACCESS_ENABLE(Settings.FILE_GFX, Settings.SECTION_GFX_HACKS, "EFBAccessEnable",
true),
GFX_HACK_EFB_DEFER_INVALIDATION(Settings.FILE_GFX, Settings.SECTION_GFX_HACKS,
"EFBAccessDeferInvalidation", false),
GFX_HACK_BBOX_ENABLE(Settings.FILE_GFX, Settings.SECTION_GFX_HACKS, "BBoxEnable", false),
GFX_HACK_SKIP_EFB_COPY_TO_RAM(Settings.FILE_GFX, Settings.SECTION_GFX_HACKS,
"EFBToTextureEnable", true),
GFX_HACK_SKIP_XFB_COPY_TO_RAM(Settings.FILE_GFX, Settings.SECTION_GFX_HACKS,
"XFBToTextureEnable", true),
GFX_HACK_DISABLE_COPY_TO_VRAM(Settings.FILE_GFX, Settings.SECTION_GFX_HACKS, "DisableCopyToVRAM",
false),
GFX_HACK_DEFER_EFB_COPIES(Settings.FILE_GFX, Settings.SECTION_GFX_HACKS, "DeferEFBCopies", true),
GFX_HACK_IMMEDIATE_XFB(Settings.FILE_GFX, Settings.SECTION_GFX_HACKS, "ImmediateXFBEnable",
false),

View File

@ -16,14 +16,15 @@ public enum MenuTag
CONFIG_WII("config_wii"),
CONFIG_ADVANCED("config_advanced"),
CONFIG_LOG("config_log"),
WIIMOTE("wiimote"),
WIIMOTE_EXTENSION("wiimote_extension"),
GCPAD_TYPE("gc_pad_type"),
GRAPHICS("graphics"),
HACKS("hacks"),
DEBUG("debug"),
GRAPHICS("graphics"),
ENHANCEMENTS("enhancements"),
STEREOSCOPY("stereoscopy"),
HACKS("hacks"),
ADVANCED_GRAPHICS("advanced_graphics"),
GCPAD_TYPE("gc_pad_type"),
WIIMOTE("wiimote"),
WIIMOTE_EXTENSION("wiimote_extension"),
GCPAD_1("gcpad", 0),
GCPAD_2("gcpad", 1),
GCPAD_3("gcpad", 2),

View File

@ -46,15 +46,16 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
titles.put(MenuTag.CONFIG_GAME_CUBE, R.string.gamecube_submenu);
titles.put(MenuTag.CONFIG_WII, R.string.wii_submenu);
titles.put(MenuTag.CONFIG_ADVANCED, R.string.advanced_submenu);
titles.put(MenuTag.WIIMOTE, R.string.wiimote_settings);
titles.put(MenuTag.WIIMOTE_EXTENSION, R.string.wiimote_extensions);
titles.put(MenuTag.GCPAD_TYPE, R.string.gcpad_settings);
titles.put(MenuTag.GRAPHICS, R.string.graphics_settings);
titles.put(MenuTag.HACKS, R.string.hacks_submenu);
titles.put(MenuTag.CONFIG_LOG, R.string.log_submenu);
titles.put(MenuTag.DEBUG, R.string.debug_submenu);
titles.put(MenuTag.GRAPHICS, R.string.graphics_settings);
titles.put(MenuTag.ENHANCEMENTS, R.string.enhancements_submenu);
titles.put(MenuTag.STEREOSCOPY, R.string.stereoscopy_submenu);
titles.put(MenuTag.HACKS, R.string.hacks_submenu);
titles.put(MenuTag.ADVANCED_GRAPHICS, R.string.advanced_graphics_submenu);
titles.put(MenuTag.CONFIG_LOG, R.string.log_submenu);
titles.put(MenuTag.GCPAD_TYPE, R.string.gcpad_settings);
titles.put(MenuTag.WIIMOTE, R.string.wiimote_settings);
titles.put(MenuTag.WIIMOTE_EXTENSION, R.string.wiimote_extensions);
titles.put(MenuTag.GCPAD_1, R.string.controller_0);
titles.put(MenuTag.GCPAD_2, R.string.controller_1);
titles.put(MenuTag.GCPAD_3, R.string.controller_2);

View File

@ -181,10 +181,18 @@ public final class SettingsFragmentPresenter
addEnhanceSettings(sl);
break;
case STEREOSCOPY:
addStereoSettings(sl);
break;
case HACKS:
addHackSettings(sl);
break;
case ADVANCED_GRAPHICS:
addAdvancedGraphicsSettings(sl);
break;
case CONFIG_LOG:
addLogConfigurationSettings(sl);
break;
@ -214,10 +222,6 @@ public final class SettingsFragmentPresenter
addExtensionTypeSettings(sl, mControllerNumber, mControllerType);
break;
case STEREOSCOPY:
addStereoSettings(sl);
break;
default:
throw new UnsupportedOperationException("Unimplemented menu");
}
@ -610,9 +614,11 @@ public final class SettingsFragmentPresenter
sl.add(new SingleChoiceSetting(mContext, IntSetting.GFX_ASPECT_RATIO, R.string.aspect_ratio, 0,
R.array.aspectRatioEntries, R.array.aspectRatioValues));
sl.add(new HeaderSetting(mContext, R.string.graphics_enhancements_and_hacks, 0));
sl.add(new HeaderSetting(mContext, R.string.graphics_more_settings, 0));
sl.add(new SubmenuSetting(mContext, R.string.enhancements_submenu, MenuTag.ENHANCEMENTS));
sl.add(new SubmenuSetting(mContext, R.string.hacks_submenu, MenuTag.HACKS));
sl.add(new SubmenuSetting(mContext, R.string.advanced_graphics_submenu,
MenuTag.ADVANCED_GRAPHICS));
}
private void addEnhanceSettings(ArrayList<SettingsItem> sl)
@ -658,14 +664,10 @@ public final class SettingsFragmentPresenter
R.string.arbitrary_mipmap_detection, R.string.arbitrary_mipmap_detection_description));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_WIDESCREEN_HACK,
R.string.wide_screen_hack, R.string.wide_screen_hack_description));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_BACKEND_MULTITHREADING,
R.string.backend_multithreading, R.string.backend_multithreading_description));
/*
Check if we support stereo
If we support desktop GL then we must support at least OpenGL 3.2
If we only support OpenGLES then we need both OpenGLES 3.1 and AEP
*/
// Check if we support stereo
// If we support desktop GL then we must support at least OpenGL 3.2
// If we only support OpenGLES then we need both OpenGLES 3.1 and AEP
EGLHelper helper = new EGLHelper(EGLHelper.EGL_OPENGL_ES2_BIT);
if ((helper.supportsOpenGL() && helper.GetVersion() >= 320) ||
@ -714,6 +716,49 @@ public final class SettingsFragmentPresenter
R.string.texture_cache_to_state, R.string.texture_cache_to_state_description));
}
private void addAdvancedGraphicsSettings(ArrayList<SettingsItem> sl)
{
sl.add(new HeaderSetting(mContext, R.string.custom_textures, 0));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_HIRES_TEXTURES,
R.string.load_custom_texture, R.string.load_custom_texture_description));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_CACHE_HIRES_TEXTURES,
R.string.cache_custom_texture, R.string.cache_custom_texture_description));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_DUMP_TEXTURES,
R.string.dump_texture, R.string.dump_texture_description));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_DUMP_BASE_TEXTURES,
R.string.dump_base_texture, R.string.dump_base_texture_description));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_DUMP_MIP_TEXTURES,
R.string.dump_mip_texture, R.string.dump_mip_texture_description));
sl.add(new HeaderSetting(mContext, R.string.misc, 0));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_CROP, R.string.crop,
R.string.crop_description));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.SYSCONF_PROGRESSIVE_SCAN,
R.string.progressive_scan, 0));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_BACKEND_MULTITHREADING,
R.string.backend_multithreading, R.string.backend_multithreading_description));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_HACK_EFB_DEFER_INVALIDATION,
R.string.defer_efb_invalidation, R.string.defer_efb_invalidation_description));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_INTERNAL_RESOLUTION_FRAME_DUMPS,
R.string.internal_resolution_dumps, R.string.internal_resolution_dumps_description));
sl.add(new HeaderSetting(mContext, R.string.debugging, 0));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_ENABLE_WIREFRAME,
R.string.wireframe, R.string.leave_this_unchecked));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_OVERLAY_STATS,
R.string.show_stats, R.string.leave_this_unchecked));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_TEXFMT_OVERLAY_ENABLE,
R.string.texture_format, R.string.leave_this_unchecked));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_ENABLE_VALIDATION_LAYER,
R.string.validation_layer, R.string.leave_this_unchecked));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_DUMP_EFB_TARGET,
R.string.dump_efb, R.string.leave_this_unchecked));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_DUMP_XFB_TARGET,
R.string.dump_xfb, R.string.leave_this_unchecked));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.GFX_HACK_DISABLE_COPY_TO_VRAM,
R.string.disable_vram_copies, R.string.leave_this_unchecked));
}
private void addLogConfigurationSettings(ArrayList<SettingsItem> sl)
{
sl.add(new CheckBoxSetting(mContext, BooleanSetting.LOGGER_WRITE_TO_FILE, R.string.log_to_file,

View File

@ -201,7 +201,7 @@
<!-- Graphics Settings -->
<string name="graphics_general">General</string>
<string name="graphics_enhancements_and_hacks">Enhancements &amp; Hacks</string>
<string name="graphics_more_settings">More</string>
<!-- Video Preference Fragment -->
<string name="video_backend">Video Backend</string>
@ -246,8 +246,6 @@
<string name="stereoscopy_convergence_description">Control the distance of the convergence plane, this is the distance at which objects will appear to be in front of the screen.\nA higher value creates stronger out-of-screen effects while a lower value is more comfortable.</string>
<string name="stereoscopy_swap_eyes">Swap Eyes</string>
<string name="stereoscopy_swap_eyes_description">Swap the left and right eye, mostly useful if you want to view side-by-side cross-eyed.</string>
<string name="backend_multithreading">Backend Multithreading</string> <!--Backend Multithreading is only disabled by default on Android -->
<string name="backend_multithreading_description">Enables graphics backend multithreading (Vulkan only). May affect performance. If unsure, leave unchecked.</string>
<string name="hacks_submenu">Hacks</string>
<string name="embedded_frame_buffer">Embedded Frame Buffer</string>
@ -285,6 +283,38 @@
<string name="wait_for_shaders">Compile Shaders Before Starting</string>
<string name="wait_for_shaders_description">This causes a delay when launching games, but will reduce stuttering early on.</string>
<string name="advanced_graphics_submenu">Advanced</string>
<string name="custom_textures">Custom Textures</string>
<string name="load_custom_texture">Load Custom Textures</string>
<string name="load_custom_texture_description">Loads custom textures from User/Load/Textures/&lt;game_id&gt;/ and User/Load/DynamicInputTextures/&lt;game_id&gt;/.</string>
<string name="cache_custom_texture">Prefetch Custom Textures</string>
<string name="cache_custom_texture_description">Caches custom textures to system RAM on startup. This can require exponentially more RAM but fixes possible stuttering.</string>
<string name="dump_texture">Dump Textures</string>
<string name="dump_texture_description">Dumps decoded game textures based on the other flags to User/Dump/Textures/&lt;game_id&gt;/. If unsure, leave this unchecked.</string>
<string name="dump_base_texture">Dump Base Textures</string>
<string name="dump_base_texture_description">Whether to dump mipmapped game textures to User/Dump/Textures/&lt;game_id&gt;/.</string>
<string name="dump_mip_texture">Dump Mip Maps</string>
<string name="dump_mip_texture_description">Whether to dump base game textures to User/Dump/Textures/&lt;game_id&gt;/.</string>
<string name="misc">Misc</string>
<string name="crop">Crop</string>
<string name="crop_description">Crops the picture from its native aspect ratio to 4:3 or 16:9. If unsure, leave this unchecked.</string>
<string name="progressive_scan">Enable Progressive Scan</string>
<string name="backend_multithreading">Backend Multithreading</string> <!--Backend Multithreading is only disabled by default on Android -->
<string name="backend_multithreading_description">Enables graphics backend multithreading (Vulkan only). May affect performance. If unsure, leave this unchecked.</string>
<string name="defer_efb_invalidation">Defer EFB Cache Invalidation</string>
<string name="defer_efb_invalidation_description">Defers invalidation of the EFB access cache until a GPU synchronization command is executed. May improve performance in some games at the cost of stability. If unsure, leave this unchecked.</string>
<string name="internal_resolution_dumps">Dump Frames at Internal Resolution</string>
<string name="internal_resolution_dumps_description">Creates frame dumps and screenshots at the internal resolution of the renderer, rather than the size of the window it is displayed within. If the aspect ratio is widescreen, the output image will be scaled horizontally to preserve the vertical resolution.</string>
<string name="debugging">Debugging</string>
<string name="wireframe">Enable Wireframe</string>
<string name="show_stats">Show Statistics</string>
<string name="texture_format">Texture Format Overlay</string>
<string name="validation_layer">Enable API Validation Layers</string>
<string name="dump_efb">Dump EFB Target</string>
<string name="dump_xfb">Dump XFB Target</string>
<string name="disable_vram_copies">Disable EFB VRAM Copies</string>
<string name="leave_this_unchecked">If unsure, leave this unchecked.</string>
<!-- Advanced Settings -->
<string name="advanced_submenu">Advanced</string>
<string name="cpu_core">CPU Core</string>