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

Clean up two recently introduced WebGL errors #97379

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

clayjohn
Copy link
Member

Fixes: #97369

There are 2 errors here:

  1. glTexParameteri can only be called on an existing texture (unlike glBindTexture which is immediately above it)
  2. GL_FRAMEBUFFER_SRGB is only available on desktop platforms. On Mobile/Web attempting to disable it results in an error. Unless the EXT_sRGB_write_control extension is available. In which case GL_FRAMEBUFFER_SRGB_EXT is available (the same value as GL_FRAMEBUFFER_SRGB) AND it is enabled by default 💀 . Therefore, we have to check for the extension and then only disable when its available.

CC @dsnopek with respect to the GL_FRAMEBUFFER_SRGB code

Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

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

Thanks!

I can't comment on the backbuffer change, but regarding the glDisable(GL_FRAMEBUFFER_SRGB) change: I retested the issue that PR #95433 aimed to fix, and it's still fixed with these changes! The code looks good to me as well.

Given that PR #95433 was cherry-picked for Godot 4.3.1, this one should be cherry-picked too. Hopefully, that's OK for the backbuffer-related fix as well?

@dsnopek dsnopek added the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Sep 23, 2024
@akien-mga akien-mga merged commit c3e16cd into godotengine:master Sep 24, 2024
19 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 4.3.1.

@akien-mga akien-mga removed the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants