Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add screen space AA option, with FXAA implementation. #37819

Merged
merged 1 commit into from
Apr 12, 2020

Conversation

reduz
Copy link
Member

@reduz reduz commented Apr 12, 2020

image

@@ -3185,6 +3185,19 @@ Viewport::MSAA Viewport::get_msaa() const {
return msaa;
}

void Viewport::set_screen_space_aa(ScreenSpaceAA p_screen_space_aa) {

ERR_FAIL_INDEX(p_screen_space_aa, 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get this warning with Clang:

scene/main/viewport.cpp:3190:2: error: result of comparison of constant 2 with expression of type 'Viewport::ScreenSpaceAA' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
        ERR_FAIL_INDEX(p_screen_space_aa, 2);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./core/error_macros.h:126:42: note: expanded from macro 'ERR_FAIL_INDEX'
        if (unlikely((m_index) < 0 || (m_index) >= (m_size))) {                                                     \
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~

Up until now we've worked this around by casting the enum value explicitly:

Suggested change
ERR_FAIL_INDEX(p_screen_space_aa, 2);
ERR_FAIL_INDEX((int)p_screen_space_aa, 2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants