From adce527880eace0ff6025fb0dc0e4b98b669ea78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Tue, 26 Aug 2025 21:01:44 +0300 Subject: [PATCH] Check renderer type when setting 3D upscaling mode. --- servers/rendering/renderer_viewport.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index 820b4c9dd0e..1ff3b2d9295 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -145,6 +145,12 @@ void RendererViewport::_configure_3d_render_buffers(Viewport *p_viewport) { scaling_3d_mode = RS::VIEWPORT_SCALING_3D_MODE_OFF; } + if (scaling_3d_mode != RS::VIEWPORT_SCALING_3D_MODE_OFF && scaling_3d_mode != RS::VIEWPORT_SCALING_3D_MODE_BILINEAR && OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") { + scaling_3d_mode = RS::VIEWPORT_SCALING_3D_MODE_BILINEAR; + scaling_type = RS::scaling_3d_mode_type(scaling_3d_mode); + WARN_PRINT_ONCE("MetalFX and FSR upscaling are not supported in the Compatibility renderer. Falling back to bilinear scaling."); + } + if (scaling_3d_mode == RS::VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL && !RD::get_singleton()->has_feature(RD::SUPPORTS_METALFX_TEMPORAL)) { if (RD::get_singleton()->has_feature(RD::SUPPORTS_METALFX_SPATIAL)) { // Prefer MetalFX spatial if it is supported, which will be much more efficient than FSR2, @@ -974,6 +980,9 @@ void RendererViewport::viewport_set_scaling_3d_mode(RID p_viewport, RS::Viewport ERR_FAIL_COND_EDMSG(p_mode == RS::VIEWPORT_SCALING_3D_MODE_FSR2, "FSR2 is only available when using the Forward+ renderer."); ERR_FAIL_COND_EDMSG(p_mode == RS::VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL, "MetalFX Temporal is only available when using the Forward+ renderer."); } + if (rendering_method == "gl_compatibility") { + ERR_FAIL_COND_EDMSG(p_mode == RS::VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL, "MetalFX Spatial is only available when using the Forward+ and Mobile renderers."); + } if (viewport->scaling_3d_mode == p_mode) { return;