GPU code
#61
To the current CPU version.
Reply
Thanks given by:
#62
Then you must have done something wrong, because the current CPU code should run much faster if refactored this way. You did keep the upscaling, didn't you?
Reply
Thanks given by:
#63
Its the memory bandwidth. Every loop has an overhead of ~40 cycles per item. So if you've got a loop for every add you end up with add operations being 40 cycles rather than one.
Reply
Thanks given by:
#64
Actually the best way to do it (nowadays) is using OpenGL ES with picture code.
because we are targetting the Raspberry PI as system, some of us may try forking Cuberite to rewrite the engine.
you use OpenGL to render Pictures where you save information. that means that one monster has one dot, each value r, g, b stands for a vector value where the monster should go. or express every position with one color dot. you dont have to display that dot, but if you want to, these would be great colorful picsBig Grin
but imagine. A LAN party with 100 ppl playing on Cuberite on a Raspberry PI.... how cheap.
Reply
Thanks given by:
#65
You could try, but my experience of trying to get GPU code working last time was that you have two major problems: Code base size and latency.
Reimplementation is a real challenge, and basically equivalent to the initial implementation resulting in separate dedicated subsystems. Maintaining the subsystems would require someone to be willing to take up all the work xoft has done and replace it. The other problem is latency, sending a job to the GPU takes time, and if that time is longer than the amount of time saved by running the job on the GPU it isn't worth it. You would not be able to run the entire server on a GPU without significant performance costs.

If you want to look into it I suggest you ignore the main core and start with the lighting subsystem. Its a nice simple piece of code, that is heavily parallel, but also extremely control flow dependent in its current version. It is also independent enough that batching it would be relatively simple compared to other subsystems.

And regarding OpenGL ES, that made most sense for the pi at the time, but for a Proof of Concept branch covering multiplatform implementation, OpenCL offered numerous advantages, particularly a better pipeline model.
Reply
Thanks given by:
#66
OpenCL acceleration would be awesome since I just got a Radeon R9 290. That thing is a compute beast. Smile
Reply
Thanks given by:




Users browsing this thread: 8 Guest(s)