Pasta News Network - New Zealand





Here are some specs up front, if you’re satisfied with piecing the story together yourself:

  • The code is on GitHub
  • Emulated RISC-V rv32ima/su+Zifencei+Zicsr instruction set
  • 64 MiB of RAM minus CPU state is stored in a 2048x2048 pixel Integer-Format texture (128 bpp)
  • Unity Custom Render Texture with buffer-swapping allows encoding/decoding state between frames
  • A pixel shader is used for emulation since compute shaders and UAV are not supported in VRChat

Around March 2021 I decided on writing an emulator capable of running a full Linux Kernel in VRChat. Due to the inherent limitations of that platform, the tool of choice had to be a shader. And after a few months of work, I’m now proud to present the worlds first (as far as I know) RISC-V CPU/SoC emulator in an HLSL pixel shader, capable of running up to 250 kHz (on a 2080 Ti) and booting Linux 5.13.5 with MMU support

Yes.

Tags: Nerdery · RISC-V