|
|
|
|
|
by AlexAltea
1272 days ago
|
|
This is fairly common in many console emulators, see: - PS3 (Nvidia RSX): https://github.com/RPCS3/rpcs3/blob/master/rpcs3/Emu/RSX/rsx... - PS4 (AMD GCN):
https://github.com/AlexAltea/orbital-qemu/blob/master/hw/ps4... The hardware is known ahead of time, so console platforms take advantage of that: GPU drivers allocate a context and hand it over to userspace which can do nearly anything it wants with it (abstraction layers are quite thin), and graphics APIs are essentially a 1:1 mapping of the hardware. Because of that there's little difference between emulating the API or emulating the GPU (the subset of the GPU accessible through the API). The only major difference I'd say is emulating the entire GPU (including VM, GART/IOMMU, display controller, multi-contexts, etc.) vs just emulating a single GPU context (which feels quite similar to implementing a graphics API). |
|