Unbind the framebuffer when updating meshes #79772
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Skeleton-driven meshes are rendered corrupted (missing, frozen, exploded, or stuttering) when running mobile XR games using the gl_compatibility renderer. Additionally users have reported streams of "Mismatch between shader number of views and FBO number of views" error messages in logcat outputs.
The cause is having an XR framebuffer with two views bound when calling the skeleton vertex shaders to deform the meshes. The skeleton shaders don't actually render to the framebuffer, but the mobile GLES drivers will still verify the shaders and framebuffer are compatible. In this case the XR framebuffer has two views (stereoscopic left and right eyes) but the shaders are not configured for two views and so GLES refuses to run the skeleton vertex shader.
This pull request fixes the issue #79769 by unbinding the framebuffer with a
glBindFramebuffer(GL_FRAMEBUFFER, 0);
at the beginning ofMeshStorage::update_mesh_instances()
at the same time rasterization is disabled.