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

Fix WebXR on desktop emulator by resetting active texture unit #84267

Merged

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Oct 31, 2023

This is such a dumb change, that I'm astonished that it fixes anything :-)

By selectively commenting out code, I found that it was RasterizerCanvasGLES3::reset_canvas() that ran when drawing 2D which fixed WebXR. So, I copied everything from that function into the end of RasterizerSceneGLES3::render_scene(), and by selectively commenting out those lines, I was able to narrow it down to this one line.

It seems super weird that changing the active texture unit fixes anything! It must mean that there's code somewhere else that's doing something with textures without remembering to set the active texture unit first? I looked around a little bit but couldn't identify what it could be.

Fixes #84255

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

This is generally a safe change to make. So let's go ahead for 4.2.

It would be ideal to track down where exactly we are modifying a texture without setting the active texture index first. But in the interest of fixing the regression, let's merge this ASAP

@akien-mga akien-mga merged commit 1bd46fe into godotengine:master Nov 1, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga changed the title Fix WebXR on desktop emulator by reseting active texture unit Fix WebXR on desktop emulator by resetting active texture unit Nov 29, 2023
@dsnopek dsnopek deleted the fix-webxr-emulator-with-no-2d branch July 22, 2024 15:29
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.

Rendering stops after entering WebXR with Godot 4.2-beta4
3 participants