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

WebGPU pipeline is hardcoded to not use multisampling #7240

Closed
radgeRayden opened this issue Jan 19, 2024 · 3 comments
Closed

WebGPU pipeline is hardcoded to not use multisampling #7240

radgeRayden opened this issue Jan 19, 2024 · 3 comments

Comments

@radgeRayden
Copy link

Version/Branch of Dear ImGui:

Version 1.90.1, Branch: docking_inter (through cimgui)

Back-ends:

imgui_impl_wgpu.cpp + imgui_impl_sdl2.cpp

Compiler, OS:

Linux + GCC 13

Full config/build information:

No response

Details:

As per https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_wgpu.cpp#L569 the pipeline object has a non configurable multisample count of 1. This means the main renderpass cannot be reused if MSAA is enabled. It's not a big inconvenience but I figured it could be desirable to have this be an init parameter or something.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

@ocornut
Copy link
Owner

ocornut commented Jan 19, 2024

What do you suggest would be a good solution?
Let the user pass a WGPUMultisampleState structure?

Perhaps we could rework WebGPU backend interface to take a struct, similar to Vulkan one.

@radgeRayden
Copy link
Author

radgeRayden commented Jan 20, 2024

What do you suggest would be a good solution? Let the user pass a WGPUMultisampleState structure?

Perhaps we could rework WebGPU backend interface to take a struct, similar to Vulkan one.

From a quick assessment it seems like there's not much more missing to make the internal pipeline consistent with the render pass. The depth buffer format is already passed as a parameter, so as long as it has the sample count such that it is compatible with the color and depth attachments, it should be fine. Currently what I have to do is create a dedicated render pass for it and not use a depth attachment at all for that pass.

ocornut added a commit that referenced this issue Jan 22, 2024
…itInfo structure instead of variety of parameters, allowing for easier further changes. (#7240)
@ocornut
Copy link
Owner

ocornut commented Jan 22, 2024

Reworked API with 831d42c and added PipelineMultisampleState with 5fc0a36
Thanks!

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

No branches or pull requests

3 participants
@ocornut @radgeRayden and others