Add a hack to disable shader subgroup shuffles

These are about 100x as expensive on adreno than nvidia due to the lack of a dedicated instruction, since some games work fine without them add a hack to disable them.
This commit is contained in:
Billy Laws 2023-01-23 21:26:04 +00:00
parent 568306195f
commit bb3baa888d
8 changed files with 18 additions and 2 deletions

@ -1 +1 @@
Subproject commit ffcaed48cd067a4e720740c09578641d29043c0d
Subproject commit 8e1d729db9f47b139ded28f74c6c9967c8412152

View File

@ -44,8 +44,9 @@ namespace skyline {
executorFlushThreshold = ktSettings.GetInt<u32>("executorFlushThreshold");
useDirectMemoryImport = ktSettings.GetBool("useDirectMemoryImport");
forceMaxGpuClocks = ktSettings.GetBool("forceMaxGpuClocks");
enableFastGpuReadbackHack = ktSettings.GetBool("enableFastGpuReadbackHack");
disableShaderCache = ktSettings.GetBool("disableShaderCache");
enableFastGpuReadbackHack = ktSettings.GetBool("enableFastGpuReadbackHack");
disableSubgroupShuffle = ktSettings.GetBool("disableSubgroupShuffle");
isAudioOutputDisabled = ktSettings.GetBool("isAudioOutputDisabled");
validationLayer = ktSettings.GetBool("validationLayer");
};

View File

@ -80,6 +80,7 @@ namespace skyline {
// Hacks
Setting<bool> enableFastGpuReadbackHack; //!< If the CPU texture readback skipping hack should be used
Setting<bool> disableSubgroupShuffle; //!< If shader subgroup suffle operations should be ignored
// Audio
Setting<bool> isAudioOutputDisabled; //!< Disables audio output

View File

@ -4,6 +4,7 @@
#include <range/v3/algorithm.hpp>
#include <boost/functional/hash.hpp>
#include <gpu.h>
#include <common/settings.h>
#include <shader_compiler/common/settings.h>
#include <shader_compiler/common/log.h>
#include <shader_compiler/frontend/maxwell/translate_program.h>
@ -122,6 +123,7 @@ namespace skyline::gpu {
.has_broken_spirv_subgroup_mask_vector_extract_dynamic = traits.quirks.brokenSubgroupMaskExtractDynamic,
.has_broken_spirv_subgroup_shuffle = traits.quirks.brokenSubgroupShuffle,
.max_subgroup_size = traits.subgroupSize,
.disable_subgroup_shuffle = *state.settings->disableSubgroupShuffle
};
Shader::Settings::values = {

View File

@ -34,6 +34,7 @@ class NativeSettings(context : Context, pref : PreferenceSettings) {
// Hacks
var enableFastGpuReadbackHack : Boolean = pref.enableFastGpuReadbackHack
var disableSubgroupShuffle : Boolean = pref.disableSubgroupShuffle
// Audio
var isAudioOutputDisabled : Boolean = pref.isAudioOutputDisabled

View File

@ -49,6 +49,7 @@ class PreferenceSettings @Inject constructor(@ApplicationContext private val con
// Hacks
var enableFastGpuReadbackHack by sharedPreferences(context, false)
var disableSubgroupShuffle by sharedPreferences(context, false)
// Audio
var isAudioOutputDisabled by sharedPreferences(context, false)

View File

@ -96,6 +96,10 @@
<string name="enable_fast_gpu_readback">Enable fast GPU readback</string>
<string name="enable_fast_gpu_readback_enabled">Fast GPU readback is enabled (Will break some games but others will have higher performance)</string>
<string name="enable_fast_gpu_readback_disabled">Fast GPU readback is disabled (Ensures highest accuracy)</string>
<string name="disable_subgroup_shuffle">Disable GPU subgroup shuffle</string>
<string name="disable_subgroup_shuffle_enabled">Shader subgroup shuffle operations are disabled, may cause severe graphical issues</string>
<string name="disable_subgroup_shuffle_disabled">Shader subgroup shuffle operations are enabled, ensures maximum accuracy</string>
<!-- Settings - Audio -->
<string name="audio">Audio</string>
<string name="disable_audio_output">Disable Audio Output</string>

View File

@ -186,6 +186,12 @@
android:summaryOn="@string/enable_fast_gpu_readback_enabled"
app:key="enable_fast_gpu_readback_hack"
app:title="@string/enable_fast_gpu_readback" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/disable_subgroup_shuffle_disabled"
android:summaryOn="@string/disable_subgroup_shuffle_enabled"
app:key="disable_subgroup_shuffle"
app:title="@string/disable_subgroup_shuffle" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_audio"