Hacker News new | ask | show | jobs
by pjc50 2420 days ago
Nice! I'd pondered using this technique for a while; since each shader compute element is a fairly powerful processor on its own, this can effectively run one copy of the emulator for every pixel.

Unfortunately since emulation is an "embarrasingly serial" problem, it doesn't go particularly quickly.

1 comments

Actually, not inherently serial. If you think about, an Apple consists of a lot of chips, which could be nicely modeled in say, Verilog, which is good for modelling parallel stuff. But it does not lend itself well to shader language.
To clarify: it does not lend itself well to ShaderToy, because the computational model is hamstrung by the fact that the threads can't communicate with each other within a draw call. On a more modern GPU platform with compute shaders, you get a lot more of that, and I think interesting things will happen. I'm personally really looking forward to WebGPU, as I think it will make a lot of this stuff much more accessible.
Unfortunately, after spending a lot of time in the committee, I think it's ultimately doomed. Chrome has WebGL-with-compute-shaders behind a flag. Really, they should have standardized and shipped that years ago.
Even when you emulate the different chips in parallel, what usually kills performance is the synchronization between them.