[OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

Paulo Pinto pjmlp at progtools.org
Mon Apr 2 17:30:20 UTC 2018


A bit off topic, yet still relevant given the ongoing attempts 
for D to be usable on the games industry.

At this year's GDC Unity had a few talks of the new subsystems 
being transitioning from internal engine code in C++ into upper 
layers written in C#.

For that purpose they are introducing a new compiler, based on 
LLVM and targeted to a subset of C# features, they are calling it 
High Performace C#.

Keypoints of the subset:

- Only structs are used, no classes;
- .NET collections are replaced by native collections that manage 
their own memory
- No code that would trigger GC is allowed
- Compiler is aware of Unity features and is able to explore 
SIMD, by doing auto-vectorization, and transparently transform 
structs fields into optimal representations

They plan to take advantage of the new C# 7.x ref type features 
after integrating the new compiler infrastructure.

"Unity at GDC - C# Sharp to Machine Code"

https://www.youtube.com/watch?v=NF6kcNS6U80

Also relevant,

"Job System & Entity Component System"
https://www.youtube.com/watch?v=kwnb9Clh2Is

"A Data Oriented Approach to Using Component Systems"

https://www.youtube.com/watch?v=p65Yt20pw0g

Some might remember Mike Acton's talk at CppCon about 
data-oriented programming, he is one of the developers leading 
this effort.

https://www.mcvuk.com/development/exclusive-unity-takes-a-principled-step-into-triple-a-performance-at-gdc



More information about the Digitalmars-d mailing list