[Resolved] WGPU application running at 1 FPS with 60 * 144 Render passes per second #7432
-
Edit: I capped the framerate at 1 FPS (see my comment) and actually WGPU can handle the workload described in the following: I am currently working on a GameBoy emulator written in Rust using WGPU for the rendering. I hoped that with this approach it would support both Desktop and Web. However, I had several problems with getting it to be compatible with the Web. My rendering setup is as follows: Therefore, I tried the following: Hence, I ended up trying the approach of using an "offscreen texture" to buffer/store the frame in and render one line to this buffer144 times per frame. This is what can be currently seen in my "offscreen_framebuffer" branch: Am I doing something wrong or is there another solution which works both on Desktop and with WebGL that can handle this? It seems like a problem that should be adressable. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
144 render passes is probably too many. Most games and applications try to use as few of these as absolutely necessary (e.g., because you need to read the results of a previous pass) and instead batch writes together. I'd recommend trying to start with a one or two render passes and finding ways to make it work within that constraint if possible. So maybe you could try something like this instead:
|
Beta Was this translation helpful? Give feedback.
-
Edit: I just noticed that I left my FPS capped at 1 FPS which I did for some testing. Setting the cap to the intended 60 FPS everything works fine and I have no performance issues. On the contrary, WGPU even seems to be capable to handle around 120-130 FPS for this workload (there is still the option of course of there being other artificial bottlenecks in my code). Therefore, I would instead frame this discussion as saying: Using a render pass 60 * 144 times per second is possible. So thanks for making that possible WGPU :) |
Beta Was this translation helpful? Give feedback.
Edit: I just noticed that I left my FPS capped at 1 FPS which I did for some testing. Setting the cap to the intended 60 FPS everything works fine and I have no performance issues. On the contrary, WGPU even seems to be capable to handle around 120-130 FPS for this workload (there is still the option of course of there being other artificial bottlenecks in my code).
Therefore, I would instead frame this discussion as saying: Using a render pass 60 * 144 times per second is possible. So thanks for making that possible WGPU :)