Repository: godotengine/godot
File: servers/rendering/renderer_viewport.cpp (C++)

Code before:
}

void RendererViewport::viewport_set_use_hdr_2d(RID p_viewport, bool p_use_hdr_2d) {
	Viewport *viewport = viewport_owner.get_or_null(p_viewport);
	ERR_FAIL_NULL(viewport);

	if (viewport->use_hdr_2d == p_use_hdr_2d) {
		return;
	}
	viewport->use_hdr_2d = p_use_hdr_2d;
	RSG::texture_storage->render_target_set_use_hdr(viewport->render_target, p_use_hdr_2d);
	_configure_3d_render_buffers(viewport);
}

bool RendererViewport::viewport_is_using_hdr_2d(RID p_viewport) const {
	Viewport *viewport = viewport_owner.get_or_null(p_viewport);
	ERR_FAIL_NULL_V(viewport, false);

	return viewport->use_hdr_2d;
}

void RendererViewport::viewport_set_screen_space_aa(RID p_viewport, RS::ViewportScreenSpaceAA p_mode) {
	Viewport *viewport = viewport_owner.get_or_null(p_viewport);
	ERR_FAIL_NULL(viewport);
	if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility" && p_mode != RS::VIEWPORT_SCREEN_SPACE_AA_DISABLED) {
		WARN_PRINT_ONCE_ED("Screen-space AA is only available when using the Compatibility renderer.");
	}

	if (viewport->screen_space_aa == p_mode) {
		return;
	}
	viewport->screen_space_aa = p_mode;
	_configure_3d_render_buffers(viewport);
}

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);
	if (OS::get_singleton()->get_current_rendering_method() != "forward_plus") {
		WARN_PRINT_ONCE_ED("TAA is only available when using the Forward+ renderer.");
	}

	if (viewport->use_taa == p_use_taa) {
		return;
	}

	bool motion_vectors_before = _viewport_requires_motion_vectors(viewport);
	viewport->use_taa = p_use_taa;

	bool motion_vectors_after = _viewport_requires_motion_vectors(viewport);
	if (motion_vectors_before != motion_vectors_after) {

Review comment (suggestion):
This is backwards, it's *not* available on the compatibility renderer, so:
```suggestion
		WARN_PRINT_ONCE_ED("Screen-space AA is only available when using the Forward+ and Mobile renderers.");
```
Or keep the original message
```suggestion
		WARN_PRINT_ONCE_ED("Screen space AA is currently unavailable on the Compatibility renderer.");
```

Code after:
}

void RendererViewport::viewport_set_msaa_3d(RID p_viewport, RS::ViewportMSAA p_msaa) {
	Viewport *viewport = viewport_owner.get_or_null(p_viewport);
	ERR_FAIL_NULL(viewport);

	if (viewport->msaa_3d == p_msaa) {
		return;
	}
	viewport->msaa_3d = p_msaa;
	_configure_3d_render_buffers(viewport);
}

void RendererViewport::viewport_set_use_hdr_2d(RID p_viewport, bool p_use_hdr_2d) {
	Viewport *viewport = viewport_owner.get_or_null(p_viewport);
	ERR_FAIL_NULL(viewport);

	if (viewport->use_hdr_2d == p_use_hdr_2d) {
		return;
	}
	viewport->use_hdr_2d = p_use_hdr_2d;
	RSG::texture_storage->render_target_set_use_hdr(viewport->render_target, p_use_hdr_2d);
	_configure_3d_render_buffers(viewport);
}

bool RendererViewport::viewport_is_using_hdr_2d(RID p_viewport) const {
	Viewport *viewport = viewport_owner.get_or_null(p_viewport);
	ERR_FAIL_NULL_V(viewport, false);

	return viewport->use_hdr_2d;
}

void RendererViewport::viewport_set_screen_space_aa(RID p_viewport, RS::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 != RS::VIEWPORT_SCREEN_SPACE_AA_DISABLED) {
		WARN_PRINT_ONCE_ED("Screen-space AA is only available when using the Forward+ or Mobile renderer.");
	}
#endif

	if (viewport->screen_space_aa == p_mode) {
		return;
	}
	viewport->screen_space_aa = p_mode;
	_configure_3d_render_buffers(viewport);
}

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);