Skip to content

Commit

Permalink
GPU: Fix more GPU thread-reading-CPU-thread-settings locations
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Feb 2, 2025
1 parent 804d90d commit 24354cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions src/core/gpu_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ bool GPU_HW::Initialize(bool upload_vram, Error* error)
m_clamp_uvs = ShouldClampUVs(m_texture_filtering) || ShouldClampUVs(m_sprite_texture_filtering);
m_compute_uv_range = m_clamp_uvs;
m_allow_sprite_mode = ShouldAllowSpriteMode(m_resolution_scale, m_texture_filtering, m_sprite_texture_filtering);
m_use_texture_cache = g_settings.gpu_texture_cache;
m_texture_dumping = m_use_texture_cache && g_settings.texture_replacements.dump_textures;
m_use_texture_cache = g_gpu_settings.gpu_texture_cache;
m_texture_dumping = m_use_texture_cache && g_gpu_settings.texture_replacements.dump_textures;

CheckSettings();

Expand Down Expand Up @@ -487,9 +487,9 @@ bool GPU_HW::UpdateSettings(const GPUSettings& old_settings, Error* error)
Host::OSD_INFO_DURATION);
}

if (m_multisamples != multisamples || g_settings.gpu_per_sample_shading != old_settings.gpu_per_sample_shading)
if (m_multisamples != multisamples || g_gpu_settings.gpu_per_sample_shading != old_settings.gpu_per_sample_shading)
{
if (g_settings.gpu_per_sample_shading && features.per_sample_shading)
if (g_gpu_settings.gpu_per_sample_shading && features.per_sample_shading)
{
Host::AddIconOSDMessage(
"MultisamplingChanged", ICON_FA_PAINT_BRUSH,
Expand Down Expand Up @@ -658,7 +658,7 @@ void GPU_HW::CheckSettings()
m_allow_sprite_mode = ShouldAllowSpriteMode(m_resolution_scale, m_texture_filtering, m_sprite_texture_filtering);
}

if (g_settings.IsUsingAccurateBlending() && !m_supports_framebuffer_fetch && !features.feedback_loops &&
if (g_gpu_settings.IsUsingAccurateBlending() && !m_supports_framebuffer_fetch && !features.feedback_loops &&
!features.raster_order_views)
{
// m_allow_shader_blend/m_prefer_shader_blend will be cleared in pipeline compile.
Expand All @@ -669,7 +669,7 @@ void GPU_HW::CheckSettings()
Host::OSD_WARNING_DURATION);
}
else if (IsUsingMultisampling() && !features.framebuffer_fetch &&
((g_settings.IsUsingAccurateBlending() && features.raster_order_views) ||
((g_gpu_settings.IsUsingAccurateBlending() && features.raster_order_views) ||
(m_pgxp_depth_buffer && features.raster_order_views && !features.feedback_loops)))
{
Host::AddIconOSDMessage(
Expand Down Expand Up @@ -787,7 +787,7 @@ bool GPU_HW::UpdateResolutionScale(Error* error)
if (CalculateResolutionScale() == m_resolution_scale)
return true;

return UpdateSettings(g_settings, error);
return UpdateSettings(g_gpu_settings, error);
}

GPUDownsampleMode GPU_HW::GetDownsampleMode(u32 resolution_scale) const
Expand Down Expand Up @@ -3992,7 +3992,7 @@ void GPU_HW::UpdateDisplay(const GPUBackendUpdateDisplayCommand* cmd)
m_presenter.SetDisplayTexture(postfx_output, 0, 0, postfx_output->GetWidth(), postfx_output->GetHeight());
}

if (g_settings.display_24bit_chroma_smoothing)
if (g_gpu_settings.display_24bit_chroma_smoothing)
{
if (m_presenter.ApplyChromaSmoothing())
{
Expand Down
6 changes: 3 additions & 3 deletions src/core/gpu_sw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ bool GPU_SW::CopyOut(u32 src_x, u32 src_y, u32 skip_x, u32 width, u32 height, u3

void GPU_SW::UpdateDisplay(const GPUBackendUpdateDisplayCommand* cmd)
{
if (!g_settings.gpu_show_vram)
if (!g_gpu_settings.gpu_show_vram)
{
if (cmd->display_disabled)
{
Expand All @@ -412,7 +412,7 @@ void GPU_SW::UpdateDisplay(const GPUBackendUpdateDisplayCommand* cmd)
if (CopyOut(src_x, src_y, skip_x, width, height, line_skip, is_24bit))
{
m_presenter.SetDisplayTexture(m_upload_texture.get(), 0, 0, width, height);
if (is_24bit && g_settings.display_24bit_chroma_smoothing)
if (is_24bit && g_gpu_settings.display_24bit_chroma_smoothing)
{
if (m_presenter.ApplyChromaSmoothing())
m_presenter.Deinterlace(field);
Expand All @@ -428,7 +428,7 @@ void GPU_SW::UpdateDisplay(const GPUBackendUpdateDisplayCommand* cmd)
if (CopyOut(src_x, src_y, skip_x, width, height, 0, is_24bit))
{
m_presenter.SetDisplayTexture(m_upload_texture.get(), 0, 0, width, height);
if (is_24bit && g_settings.display_24bit_chroma_smoothing)
if (is_24bit && g_gpu_settings.display_24bit_chroma_smoothing)
m_presenter.ApplyChromaSmoothing();
}
}
Expand Down

0 comments on commit 24354cb

Please sign in to comment.