Shader Systems Are Ridiculously Powerful If You're Clever Enough
Key topics
But this is worth reading:
Quoting:
Laurie Kirk
Shader systems are ridiculously powerful if you’re clever enough.
Most people use them to create visual effects. You know what’s cooler?
Running Linux.
Inside an emulated RISC-V CPU. Inside a pixel shader. Inside of VRChat...
—
VRChat allows users to embed custom fragment shaders within worlds.
Of course, you don’t just get to run arbitrary C code wherever you want; that would be an insane security risk.
But, you do have textures. Textures that can hold state.
—
By abusing the heck out of shader logic, you can do some funny things.
To run linux in a shader, you first need a (simulated) CPU.
Of course, someone took it to the logical extreme; and emulated RISC-V logic in HLSL.
~64MiB of “Ram” stored as a texture.
—
Tick between frames fast enough, and you get a (somewhat useable) CPU.
About ~250 kilohertz on a 2080Ti.
Not much, but enough to run Linux!
What I love most is that you can visually “see” the system state at any point just by viewing the texture itself.
========
From:
https://www.linkedin.com/posts/laurie-kirk_shader-systems-are-ridiculously-powerful-ugcPost-7393761568427016192-08-x
The post showcases the creative use of shader systems to emulate a RISC-V CPU and run Linux within VRChat, highlighting the potential of shader systems when used innovatively.
Snapshot generated from the HN discussion
Discussion Activity
No activity data yet
We're still syncing comments from Hacker News.
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Discussion hasn't started yet.