khonsulabs / kludgine

A kludgey 2d game engine written in Rust atop wgpu
64 stars 4 forks source link

Make Kludgine work on the web #49

Open ecton opened 3 years ago

ecton commented 3 years ago

This is an issue tracking the progress of making Kludgine run in a web browser using WASM. The current status is that running in a browser is not working at the moment. The current work-in-progress attempt at a simple example working can be seen here.

ecton commented 3 years ago

Today I made a significant amount of progress -- Kludgine now compiles to WASM successfully. Significant changes to easygpu were needed to support this, but the tl;dr is: Kludgine is not yet working in the browser. I wasn't expecting to have success today and am still thrilled with the progress made.

What is working:

What isn't working:

I'm very happy with the progress today. While nothing was drawn to the screen, I did succeed in getting a large portion of the engine runtime working -- for the engine to get to the location it did to crash, it means that the entire async app runtime is functioning correctly.

This issue is likely going to be tabled until the next wgpu update -- it's a goal for Cosmic Verge but it's not something that I need in the near future.

ecton commented 3 years ago

easygpu has been updated to wgpu-0.8.1. Progress has been made, shader code is executing. However, the shader isn't compatible with naga without enabling cross in wgpu. Rather than spend time debugging that, I'd rather figure out the better approach to embedding shaders (rust-gpu?) and then figure out what isn't working.

The other challenges that I knew I ran into last time but didn't address here:

ecton commented 1 year ago

With the rewrite, this is now going to be blocked by khonsulabs/appit#1 in addition to some of the previous findings.