Fix 3D rendering jittering when TAA is enabled in the Mobile renderer
The Mobile renderer doesn't support TAA, but we still configured the 3D buffers as if TAA was enabled after turning an error into a warning previously. This also adds a similar early return to screen-space AA when on Compatibility to avoid unnecessary 3D buffer reconfiguration.
This commit is contained in:
@@ -1022,23 +1022,25 @@ void RendererViewport::viewport_set_use_xr(RID p_viewport, bool p_use_xr) {
|
||||
void RendererViewport::viewport_set_scaling_3d_mode(RID p_viewport, RSE::ViewportScaling3DMode p_mode) {
|
||||
Viewport *viewport = viewport_owner.get_or_null(p_viewport);
|
||||
ERR_FAIL_NULL(viewport);
|
||||
#ifdef DEBUG_ENABLED
|
||||
const String rendering_method = OS::get_singleton()->get_current_rendering_method();
|
||||
if (rendering_method != "forward_plus") {
|
||||
if (p_mode == RSE::VIEWPORT_SCALING_3D_MODE_FSR) {
|
||||
WARN_PRINT_ONCE_ED("FSR1 3D scaling is only available when using the Forward+ renderer.");
|
||||
return;
|
||||
}
|
||||
if (p_mode == RSE::VIEWPORT_SCALING_3D_MODE_FSR2) {
|
||||
WARN_PRINT_ONCE_ED("FSR2 3D scaling is only available when using the Forward+ renderer.");
|
||||
return;
|
||||
}
|
||||
if (p_mode == RSE::VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL) {
|
||||
WARN_PRINT_ONCE_ED("MetalFX Temporal 3D scaling is only available when using the Forward+ renderer.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (rendering_method == "gl_compatibility" && p_mode == RSE::VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL) {
|
||||
WARN_PRINT_ONCE_ED("MetalFX Spatial 3D scaling is only available when using the Forward+ or Mobile renderer.");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (viewport->scaling_3d_mode == p_mode) {
|
||||
return;
|
||||
@@ -1429,11 +1431,10 @@ bool RendererViewport::viewport_is_using_hdr_2d(RID p_viewport) const {
|
||||
void RendererViewport::viewport_set_screen_space_aa(RID p_viewport, RSE::ViewportScreenSpaceAA p_mode) {
|
||||
Viewport *viewport = viewport_owner.get_or_null(p_viewport);
|
||||
ERR_FAIL_NULL(viewport);
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility" && p_mode != RSE::VIEWPORT_SCREEN_SPACE_AA_DISABLED) {
|
||||
WARN_PRINT_ONCE_ED("Screen-space AA is only available when using the Forward+ or Mobile renderer.");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (viewport->screen_space_aa == p_mode) {
|
||||
return;
|
||||
@@ -1445,11 +1446,10 @@ void RendererViewport::viewport_set_screen_space_aa(RID p_viewport, RSE::Viewpor
|
||||
void RendererViewport::viewport_set_use_taa(RID p_viewport, bool p_use_taa) {
|
||||
Viewport *viewport = viewport_owner.get_or_null(p_viewport);
|
||||
ERR_FAIL_NULL(viewport);
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() != "forward_plus") {
|
||||
WARN_PRINT_ONCE_ED("TAA is only available when using the Forward+ renderer.");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (viewport->use_taa == p_use_taa) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user