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

Add WebGPU implementation #35

Open
sh54 opened this issue Jan 27, 2021 · 0 comments
Open

Add WebGPU implementation #35

sh54 opened this issue Jan 27, 2021 · 0 comments

Comments

@sh54
Copy link
Contributor

sh54 commented Jan 27, 2021

It would be nice to target WebGPU too. That should eventually be replacing WebGL. Its api is starting to settle down so any breaking changes will probably just be name stuff and petty argument changes rather than anything big.

I don't mind implementing it. I am using this library with clojurescript and I have it rendering via WebGPU there. Porting it over should not be much of a hassle.

One question I have is structuring related. All the HTML platform stuff (canvas_on_keydown etc) is the same so really should be shared. In my own implementation I keep the platform and renderer stuff separate. This maps up to the imgui concept that there is a io.BackendPlatformName and a io.BackendRendererName.

I propose splitting out the html platform stuff into its own file. Then add a WebGL renderer file, a new WebGPU renderer file, and perhaps split out the canvas fallback renderer into its own file. To maintain backwards compatibility keep imgui_impl.ts (and thus imgui_impl.umd.js) but it would just import in the html platform implementation and the webgl renderer plus the canvas renderer as fallback.

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

No branches or pull requests

1 participant