mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Merge pull request #109993 from bruvzg/upscale_gl_check
Check renderer type when setting 3D upscaling mode.
This commit is contained in:
commit
b86d05e7f8
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue