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

Wgpu 23 (GLES) no longer works on devices with max_color_attachments == 4. #6986

Open
adrian17 opened this issue Jan 24, 2025 · 3 comments · May be fixed by #6994
Open

Wgpu 23 (GLES) no longer works on devices with max_color_attachments == 4. #6986

adrian17 opened this issue Jan 24, 2025 · 3 comments · May be fixed by #6994
Labels
area: api Issues related to API surface type: bug Something isn't working

Comments

@adrian17
Copy link

adrian17 commented Jan 24, 2025

Description
On v22 and before, wgpu initialized on devices with max_color_attachments == 4. This includes some Android and Windows devices, and possibly some browsers with WebGL2. On v23 and above, it fails with Limit 'max_color_attachments' value 8 is better than allowed 4.

Repro steps
If you don't happen to have such a device, you can use JS to easily pretend, just enter this snippet in devtools console before the wgpu application with webgl backend initializes:

var temp = WebGL2RenderingContext.prototype.getParameter; WebGL2RenderingContext.prototype.getParameter = function(n){    if (n == 0x8CDF) { return 4; } return temp.call(this, n);  }

Expected vs observed behavior
Making it possible to support these devices again. AFAIK, dropping support for them was not documented in changelog.

If it turns out that the limit was always supposed to be 8 and allowing these devices to use wgpu was an accident, then we'd still appreciate some optional way to drop it back to 4 - since we don't even need 4 for our use cases AFAIK.

@adrian17
Copy link
Author

For the record: we use wgpu::Limits::downlevel_webgl2_defaults. They are documented as

These default limits are guaranteed to be compatible with GLES-3.0, and D3D11, and WebGL2

But the GLES3 minimum for MAX_COLOR_ATTACHMENTS is 4.

@cwfitzgerald
Copy link
Member

cwfitzgerald commented Jan 24, 2025

Sounds like the downlevel limits need to be reduced to 4 - can you submit a PR? This limit was previously not enforced

@cwfitzgerald cwfitzgerald added type: bug Something isn't working area: api Issues related to API surface labels Jan 24, 2025
@adrian17
Copy link
Author

I can, sure. The only caveat is that we don't have access to any real android devices with this issue, so I can't prove that this is the only thing needed to fix; we might only realize this some time after release.

@adrian17 adrian17 linked a pull request Jan 26, 2025 that will close this issue
7 tasks
@Wumpf Wumpf linked a pull request Jan 26, 2025 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Issues related to API surface type: bug Something isn't working
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants