Skip to content

Conversation

@Xavientois
Copy link

@Xavientois Xavientois commented Jan 26, 2026

Summary

  • Adds a new GlRobustness enum with Auto (default) and Disabled variants
  • Adds robustness field to GlBackendOptions
  • Adds environment variable support via WGPU_GL_ROBUSTNESS

Problem

On some drivers or platforms, EGL robustness context creation (EGL_EXT_create_context_robustness or EGL 1.5 core) can fail, causing adapter enumeration to fail with errors like:

Can't get wgpu adapter => No suitable adapter found:
  No suitable graphics adapter found; noop not requested, vulkan not requested, metal not requested, dx12 not requested, gl drivers/libraries could not be loaded, webgpu not requested

Solution

Add a public API option to disable EGL robustness context creation. When GlRobustness::Disabled is set, the backend skips attempting to create a robust context entirely.

Usage

Via API:

let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
    backend_options: wgpu::BackendOptions {
        gl: wgpu::GlBackendOptions {
            robustness: wgpu::GlRobustness::Disabled,
            ..Default::default()
        },
        ..Default::default()
    },
    ..Default::default()
});

Via environment variable:

WGPU_GL_ROBUSTNESS=disabled ./your_app

Test

  • cargo build succeeds
  • cargo clippy --tests passes (no new warnings)
  • Hard-coding robustness to disabled has worked as a fix for us at Pinterest

This PR description was written by AI.

…obustness

Add a new `robustness` field to `GlBackendOptions` that allows users to
disable EGL robustness context creation. This can work around context
creation failures on some drivers that cause adapter enumeration to fail
with "gl drivers/libraries could not be loaded" errors.

The new `GlRobustness` enum has two variants:
- `Auto` (default): Attempt robust context creation, fall back if it fails
- `Disabled`: Skip robustness entirely

Can be set via:
- API: `GlBackendOptions { robustness: GlRobustness::Disabled, .. }`
- Environment variable: `WGPU_GL_ROBUSTNESS=disabled`
@Xavientois Xavientois marked this pull request as draft January 26, 2026 20:34
@Xavientois Xavientois changed the title [AI-Generated] feat(gles): Add GlRobustness option to disable EGL robustness feat(gles): Add GlRobustness option to disable EGL robustness Jan 26, 2026
@inner-daemons
Copy link
Collaborator

Note to anyone else: this is also AI-generated in its entirety.

@Xavientois
Copy link
Author

@inner-daemons If you'd like, I can re-add the label in the title to make it very clear to reviewers that it's AI-generated.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants