Skip to content

Small fix to allow PlatformEGL to work on non-Android targets.#9724

Merged
poweifeng merged 2 commits into
google:mainfrom
haroonq:main
Mar 5, 2026
Merged

Small fix to allow PlatformEGL to work on non-Android targets.#9724
poweifeng merged 2 commits into
google:mainfrom
haroonq:main

Conversation

@haroonq
Copy link
Copy Markdown
Contributor

@haroonq haroonq commented Feb 18, 2026

Don't assume glGetString(GL_EXTENSIONS) returns a non-null value as null is a possible return value for OpenGL (desktop).

@poweifeng poweifeng added the internal Issue/PR does not affect clients label Feb 18, 2026
Comment thread filament/backend/src/opengl/platforms/PlatformEGLHeadless.cpp
Comment thread filament/backend/src/opengl/platforms/PlatformEGLHeadless.cpp Outdated
Copy link
Copy Markdown
Collaborator

@pixelflinger pixelflinger left a comment

Choose a reason for hiding this comment

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

let's split this PR. The first part with checking for null is fine. I'm not convinced about including gl_headers, I don't quite understand the problem.

@haroonq haroonq closed this Feb 19, 2026
@haroonq haroonq reopened this Feb 19, 2026
@haroonq haroonq changed the title Small fixes to allow PlatformEGL to work on non-Android targets. Small fix to allow PlatformEGL to work on non-Android targets. Feb 19, 2026
@haroonq
Copy link
Copy Markdown
Contributor Author

haroonq commented Feb 19, 2026

let's split this PR. The first part with checking for null is fine. I'm not convinced about including gl_headers, I don't quite understand the problem.

Reverted the change to PlatformEGLHeadless.

For context, on line 38, it checks for #if defined(BACKEND_OPENGL_VERSION_GL) to determine if we're dealing with OpenGL or GLES. However, BACKEND_OPENGL_VERSION_GL is only defined in gl_headers.h. Without including this header, this define is never set and, therefore, this class will always assume it's only for GLES.

Copy link
Copy Markdown
Contributor Author

@haroonq haroonq left a comment

Choose a reason for hiding this comment

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

.

haroonq added 2 commits March 5, 2026 22:08
- Include gl_headers.h since it defines BACKEND_OPENGL_VERSION_GL(ES)
    depending on which headers are available.
- Don't assume glGetString(GL_EXTENSIONS) returns a non-null value as
    null is a possible return value for OpenGL (desktop).
@poweifeng poweifeng merged commit 0b8dbe9 into google:main Mar 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Issue/PR does not affect clients

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants