Skip to content

Commit

Permalink
Settings: Add missing GPU feature disables
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Dec 6, 2024
1 parent 6d080c1 commit 5c4d95f
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 15 deletions.
4 changes: 4 additions & 0 deletions src/core/host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ bool Host::CreateGPUDevice(RenderAPI api, bool fullscreen, Error* error)
disabled_features |= GPUDevice::FEATURE_MASK_MEMORY_IMPORT;
if (g_settings.gpu_disable_raster_order_views)
disabled_features |= GPUDevice::FEATURE_MASK_RASTER_ORDER_VIEWS;
if (g_settings.gpu_disable_compute_shaders)
disabled_features |= GPUDevice::FEATURE_MASK_COMPUTE_SHADERS;
if (g_settings.gpu_disable_compressed_textures)
disabled_features |= GPUDevice::FEATURE_MASK_COMPRESSED_TEXTURES;

// Don't dump shaders on debug builds for Android, users will complain about storage...
#if !defined(__ANDROID__) || defined(_DEBUG)
Expand Down
4 changes: 4 additions & 0 deletions src/core/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ void Settings::Load(const SettingsInterface& si, const SettingsInterface& contro
gpu_disable_texture_copy_to_self = si.GetBoolValue("GPU", "DisableTextureCopyToSelf", false);
gpu_disable_memory_import = si.GetBoolValue("GPU", "DisableMemoryImport", false);
gpu_disable_raster_order_views = si.GetBoolValue("GPU", "DisableRasterOrderViews", false);
gpu_disable_compute_shaders = si.GetBoolValue("GPU", "DisableComputeShaders", false);
gpu_disable_compressed_textures = si.GetBoolValue("GPU", "DisableCompressedTextures", false);
gpu_per_sample_shading = si.GetBoolValue("GPU", "PerSampleShading", false);
gpu_use_thread = si.GetBoolValue("GPU", "UseThread", true);
gpu_use_software_renderer_for_readbacks = si.GetBoolValue("GPU", "UseSoftwareRendererForReadbacks", false);
Expand Down Expand Up @@ -539,6 +541,8 @@ void Settings::Save(SettingsInterface& si, bool ignore_base) const
si.SetBoolValue("GPU", "DisableTextureCopyToSelf", gpu_disable_texture_copy_to_self);
si.SetBoolValue("GPU", "DisableMemoryImport", gpu_disable_memory_import);
si.SetBoolValue("GPU", "DisableRasterOrderViews", gpu_disable_raster_order_views);
si.SetBoolValue("GPU", "DisableComputeShaders", gpu_disable_compute_shaders);
si.SetBoolValue("GPU", "DisableCompressedTextures", gpu_disable_compressed_textures);
}

si.SetBoolValue("GPU", "PerSampleShading", gpu_per_sample_shading);
Expand Down
2 changes: 2 additions & 0 deletions src/core/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ struct Settings
bool gpu_disable_texture_copy_to_self : 1 = false;
bool gpu_disable_memory_import : 1 = false;
bool gpu_disable_raster_order_views : 1 = false;
bool gpu_disable_compute_shaders : 1 = false;
bool gpu_disable_compressed_textures : 1 = false;
bool gpu_per_sample_shading : 1 = false;
bool gpu_true_color : 1 = true;
bool gpu_scaled_dithering : 1 = true;
Expand Down
4 changes: 4 additions & 0 deletions src/core/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4244,6 +4244,8 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
g_settings.gpu_disable_texture_copy_to_self != old_settings.gpu_disable_texture_copy_to_self ||
g_settings.gpu_disable_memory_import != old_settings.gpu_disable_memory_import ||
g_settings.gpu_disable_raster_order_views != old_settings.gpu_disable_raster_order_views ||
g_settings.gpu_disable_compute_shaders != old_settings.gpu_disable_compute_shaders ||
g_settings.gpu_disable_compressed_textures != old_settings.gpu_disable_compressed_textures ||
g_settings.display_exclusive_fullscreen_control != old_settings.display_exclusive_fullscreen_control))
{
// if debug device/threaded presentation change, we need to recreate the whole display
Expand All @@ -4256,6 +4258,8 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
g_settings.gpu_disable_texture_copy_to_self != old_settings.gpu_disable_texture_copy_to_self ||
g_settings.gpu_disable_memory_import != old_settings.gpu_disable_memory_import ||
g_settings.gpu_disable_raster_order_views != old_settings.gpu_disable_raster_order_views ||
g_settings.gpu_disable_compute_shaders != old_settings.gpu_disable_compute_shaders ||
g_settings.gpu_disable_compressed_textures != old_settings.gpu_disable_compressed_textures ||
g_settings.display_exclusive_fullscreen_control != old_settings.display_exclusive_fullscreen_control);

Host::AddIconOSDMessage("RendererSwitch", ICON_FA_PAINT_ROLLER,
Expand Down
12 changes: 12 additions & 0 deletions src/duckstation-qt/graphicssettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.disableTextureBuffers, "GPU", "DisableTextureBuffers", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.disableTextureCopyToSelf, "GPU", "DisableTextureCopyToSelf",
false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.disableMemoryImport, "GPU", "DisableMemoryImport", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.disableRasterOrderViews, "GPU", "DisableRasterOrderViews",
false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.disableComputeShaders, "GPU", "DisableComputeShaders", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.disableCompressedTextures, "GPU", "DisableCompressedTextures",
false);

// Init all dependent options.
updateRendererDependentOptions();
Expand Down Expand Up @@ -632,6 +638,12 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
dialog->registerWidgetHelp(m_ui.disableRasterOrderViews, tr("Disable Rasterizer Order Views"), tr("Unchecked"),
tr("Disables the use of rasterizer order views. Useful for testing broken graphics "
"drivers. <strong>Only for developer use.</strong>"));
dialog->registerWidgetHelp(m_ui.disableComputeShaders, tr("Disable Compute Shaders"), tr("Unchecked"),
tr("Disables the use of compute shaders. Useful for testing broken graphics drivers. "
"<strong>Only for developer use.</strong>"));
dialog->registerWidgetHelp(m_ui.disableCompressedTextures, tr("Disable Compressed Textures"), tr("Unchecked"),
tr("Disables the use of compressed textures. Useful for testing broken graphics drivers. "
"<strong>Only for developer use.</strong>"));
}

GraphicsSettingsWidget::~GraphicsSettingsWidget() = default;
Expand Down
44 changes: 29 additions & 15 deletions src/duckstation-qt/graphicssettingswidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1331,17 +1331,17 @@
<layout class="QFormLayout" name="formLayout_10">
<item row="0" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_8">
<item row="2" column="1">
<widget class="QCheckBox" name="disableTextureCopyToSelf">
<item row="0" column="0">
<widget class="QCheckBox" name="useDebugDevice">
<property name="text">
<string>Disable Texture Copy To Self</string>
<string>Use Debug Device</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="useDebugDevice">
<item row="2" column="0">
<widget class="QCheckBox" name="disableTextureBuffers">
<property name="text">
<string>Use Debug Device</string>
<string>Disable Texture Buffers</string>
</property>
</widget>
</item>
Expand All @@ -1352,24 +1352,24 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="disableFramebufferFetch">
<item row="0" column="1">
<widget class="QCheckBox" name="disableShaderCache">
<property name="text">
<string>Disable Framebuffer Fetch</string>
<string>Disable Shader Cache</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="disableTextureBuffers">
<item row="1" column="1">
<widget class="QCheckBox" name="disableFramebufferFetch">
<property name="text">
<string>Disable Texture Buffers</string>
<string>Disable Framebuffer Fetch</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="disableShaderCache">
<item row="2" column="1">
<widget class="QCheckBox" name="disableTextureCopyToSelf">
<property name="text">
<string>Disable Shader Cache</string>
<string>Disable Texture Copy To Self</string>
</property>
</widget>
</item>
Expand All @@ -1387,6 +1387,20 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="disableComputeShaders">
<property name="text">
<string>Disable Compute Shaders</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="disableCompressedTextures">
<property name="text">
<string>Disable Compressed Textures</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down

0 comments on commit 5c4d95f

Please sign in to comment.