-
Notifications
You must be signed in to change notification settings - Fork 909
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
In OpenGL backend, attempting to render to a multisampled texture with the usages RENDER_ATTACHMENT | TEXTURE_BINDING
fails
#6084
Comments
Thank you so much for diving deep and providing a repro case, but I'm pretty certain this is the same as this issue
wgpu is lacking the validation & downlevel feature to express this and that's what above linked issue is about |
Thanks for linking that issue, they do seem to be the same.
Neither of these solutions is particularly appealing to me. Is this limitation simply a shortcoming of wgpu's implementation, in which case I should probably fork it and maintain my own, or is it a fundamental limitation of GL, and I should just find a different rendering technique for my application that does not depend directly on multisampled textures? |
@RedMindZ I think those are your option pretty much, yes. Not sure if adding In general, the OpenGL backend is not WebGPU compliant and not meant to be either. It's more of a fallback solution when all else fails because of either very old driver & hardware (on Apple Metal is always available and elsewhere Vulkan support is very widespread) or for running via WebGL in a browser that doesn't yet implement WebGPU. WebGPU is designed with Vulkan/Metal/DX12 in mind and this won't be the only unsupported thing you're hitting (although most things are now covered well enough by the feature/downlevel-feature system) |
Hmm I searched a little bit and I think there's actually different bug here: This API is available on OpenGL 4.2+ and GLES 3.1+ so this should be supported in your case Updating the other ticket consequently. Contributions welcome ;) |
Thank you so much for this gold mine of information! |
Description
When creating a multisampled texture with the usages
TextureUsages::RENDER_ATTACHMENT | TextureUsages::TEXTURE_BINDING
and rendering to it with the OpenGL backend, rendering fails, the screen remains black, and the following errors are logged by wgpu:Note that there is no crush, it simply appears that the render pass is aborted.
Repro steps
I have created a simple example here.
The example is based on the
hello_triangle
example of wgpu.In the example, we attempt to render the triangle to a multisampled texture in the first render pass, and then perform a second render pass to load pixels from the multisampled texture and output them to the surface texture.
The important lines of
main.rs
are as follows:RENDER_ATTACHMENT
andTEXTURE_BINDING
.Expected vs observed behavior
Given that this setup works in Vulkan and DX12, I expected this to work with GL as well.
When changing lines 89-93, 107, 153 to use a single sample instead (aka, a non-multisampled texture), and changing line 14 in
blit.wgsl
to usetexture_2d
instead oftexture_multisampled_2d
this example works fine.Platform
OS: Window 10
GPU: Nvidia GTX 1080
wgpu: 22.1.0
The text was updated successfully, but these errors were encountered: