Update Android GUI settings for Hybrid XFB

This commit is contained in:
JosJuice 2017-12-17 13:50:47 +01:00
parent ba01642dc7
commit acee8b1e23
5 changed files with 11 additions and 81 deletions

View File

@ -262,10 +262,6 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
{
putVideoBackendSetting(which);
}
else if (scSetting.getKey().equals(SettingsFile.KEY_XFB_METHOD))
{
putXfbSetting(which);
}
else if (scSetting.getKey().equals(SettingsFile.KEY_UBERSHADER_MODE))
{
putUberShaderModeSetting(which);
@ -406,33 +402,6 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
mView.putSetting(gfxBackend);
}
public void putXfbSetting(int which)
{
BooleanSetting xfbEnable = null;
BooleanSetting xfbReal = null;
switch (which)
{
case 0:
xfbEnable = new BooleanSetting(SettingsFile.KEY_XFB, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, false);
xfbReal = new BooleanSetting(SettingsFile.KEY_XFB_REAL, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, false);
break;
case 1:
xfbEnable = new BooleanSetting(SettingsFile.KEY_XFB, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, true);
xfbReal = new BooleanSetting(SettingsFile.KEY_XFB_REAL, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, false);
break;
case 2:
xfbEnable = new BooleanSetting(SettingsFile.KEY_XFB, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, true);
xfbReal = new BooleanSetting(SettingsFile.KEY_XFB_REAL, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, true);
break;
}
mView.putSetting(xfbEnable);
mView.putSetting(xfbReal);
}
public void putUberShaderModeSetting(int which)
{
BooleanSetting disableSpecializedShaders = null;

View File

@ -317,14 +317,14 @@ public final class SettingsFragmentPresenter
{
boolean skipEFBValue = getInvertedBooleanValue(SettingsFile.SETTINGS_GFX, SettingsFile.SECTION_GFX_HACKS, SettingsFile.KEY_SKIP_EFB, false);
boolean ignoreFormatValue = getInvertedBooleanValue(SettingsFile.SETTINGS_GFX, SettingsFile.SECTION_GFX_HACKS, SettingsFile.KEY_IGNORE_FORMAT, true);
int xfbValue = getXfbValue();
BooleanSetting skipEFB = new BooleanSetting(SettingsFile.KEY_SKIP_EFB, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, skipEFBValue);
BooleanSetting ignoreFormat = new BooleanSetting(SettingsFile.KEY_IGNORE_FORMAT, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, ignoreFormatValue);
Setting efbToTexture = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_EFB_TEXTURE);
Setting texCacheAccuracy = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_TEXCACHE_ACCURACY);
Setting gpuTextureDecoding = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_GPU_TEXTURE_DECODING);
IntSetting xfb = new IntSetting(SettingsFile.KEY_XFB, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, xfbValue);
Setting xfbToTexture = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_XFB_TEXTURE);
Setting immediateXfb = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_IMMEDIATE_XFB);
Setting fastDepth = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_FAST_DEPTH);
Setting aspectRatio = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_ASPECT_RATIO);
@ -338,7 +338,8 @@ public final class SettingsFragmentPresenter
sl.add(new CheckBoxSetting(SettingsFile.KEY_GPU_TEXTURE_DECODING, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.gpu_texture_decoding, R.string.gpu_texture_decoding_descrip, false, gpuTextureDecoding));
sl.add(new HeaderSetting(null, null, R.string.external_frame_buffer, 0));
sl.add(new SingleChoiceSetting(SettingsFile.KEY_XFB_METHOD, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.external_frame_buffer, R.string.external_frame_buffer_descrip, R.array.externalFrameBufferEntries, R.array.externalFrameBufferValues, 0, xfb));
sl.add(new CheckBoxSetting(SettingsFile.KEY_XFB_TEXTURE, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.xfb_copy_method, R.string.xfb_copy_method_descrip, true, xfbToTexture));
sl.add(new CheckBoxSetting(SettingsFile.KEY_IMMEDIATE_XFB, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.immediate_xfb, R.string.immediate_xfb_descrip, false, immediateXfb));
sl.add(new HeaderSetting(null, null, R.string.other, 0));
sl.add(new CheckBoxSetting(SettingsFile.KEY_FAST_DEPTH, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.fast_depth_calculation, R.string.fast_depth_calculation_descrip, true, fastDepth));
@ -798,36 +799,6 @@ public final class SettingsFragmentPresenter
return videoBackendValue;
}
private int getXfbValue()
{
int xfbValue;
try
{
boolean usingXFB = ((BooleanSetting) mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_XFB)).getValue();
boolean usingRealXFB = ((BooleanSetting) mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_XFB_REAL)).getValue();
if (!usingXFB)
{
xfbValue = 0;
}
else if (!usingRealXFB)
{
xfbValue = 1;
}
else
{
xfbValue = 2;
}
}
catch (NullPointerException ex)
{
xfbValue = 0;
}
return xfbValue;
}
private int getUberShaderModeValue()
{
int uberShaderModeValue = 0;

View File

@ -103,11 +103,10 @@ public final class SettingsFile
public static final String KEY_EFB_TEXTURE = "EFBToTextureEnable";
public static final String KEY_TEXCACHE_ACCURACY = "SafeTextureCacheColorSamples";
public static final String KEY_GPU_TEXTURE_DECODING = "EnableGPUTextureDecoding";
public static final String KEY_XFB = "UseXFB";
public static final String KEY_XFB_REAL = "UseRealXFB";
public static final String KEY_XFB_TEXTURE = "XFBToTextureEnable";
public static final String KEY_IMMEDIATE_XFB = "ImmediateXFBEnable";
public static final String KEY_FAST_DEPTH = "FastDepthCalc";
public static final String KEY_ASPECT_RATIO = "AspectRatio";
public static final String KEY_UBERSHADER_MODE = "UberShaderMode";
public static final String KEY_DISABLE_SPECIALIZED_SHADERS = "DisableSpecializedShaders";
public static final String KEY_BACKGROUND_SHADER_COMPILING = "BackgroundShaderCompiling";
@ -267,7 +266,7 @@ public final class SettingsFile
// Internal only, not actually found in settings file.
public static final String KEY_VIDEO_BACKEND_INDEX = "VideoBackendIndex";
public static final String KEY_XFB_METHOD = "XFBMethod";
public static final String KEY_UBERSHADER_MODE = "UberShaderMode";
private SettingsFile()
{

View File

@ -91,18 +91,6 @@
<item>0</item>
</integer-array>
<!-- External Frame Buffer Preference -->
<string-array name="externalFrameBufferEntries" translatable="false">
<item>Disabled</item>
<item>Virtual</item>
<item>Real</item>
</string-array>
<integer-array name="externalFrameBufferValues" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
</integer-array>
<!-- Ubershader Mode Preference -->
<string-array name="uberShaderModeEntries" translatable="false">
<item>Disabled</item>

View File

@ -174,7 +174,10 @@
<string name="gpu_texture_decoding">GPU Texture Decoding</string>
<string name="gpu_texture_decoding_descrip">Decodes textures on the GPU using compute shaders where supported. May improve performance in some scenarios.</string>
<string name="external_frame_buffer">External Frame Buffer</string>
<string name="external_frame_buffer_descrip">Determines how the XFB will be emulated.</string>
<string name="xfb_copy_method">Store XFB Copies to Texture Only</string>
<string name="xfb_copy_method_descrip">Stores XFB Copies exclusively on the GPU, bypassing system memory. Causes graphical defects in a small number of games that need to readback from memory. If unsure, leave this checked.</string>
<string name="immediate_xfb">Immediately Present XFB</string>
<string name="immediate_xfb_descrip">Displays the XFB copies as soon as they are created, without waiting for scanout. Causes graphical defects in some games but reduces latency. If unsure, leave this unchecked.</string>
<string name="disable_destination_alpha">Disable Destination Alpha</string>
<string name="disable_destination_alpha_descrip">Disables emulation of a hardware feature called destination alpha, which is used in many games for various effects.</string>
<string name="fast_depth_calculation">Fast Depth Calculation</string>