Retro Undefinied Renderer

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
Noiecity
Posts: 314
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Retro Undefinied Renderer

Post by Noiecity »

I built a fairly compatible and portable CPU renderer using only C++98 and windows.h, but it requires a very old version of Mingw to compile, Mingw 32-bits runtime version 3.7, gcc 3.4.2(with dev c++ 4.9.9.2 in Windows 7). I haven't been able to compile it in modern versions; I'm simply too ignorant to do so(It literally compiles in 1 second or less in mingw 3.7.). I built it while trying to solve some problems I noticed in software renderer. Logically, video burning is a more up-to-date version, although it consumes more resources.

It is completely branchless as possible. It consumes very little CPU.

They're like PS1 graphics, I guess that's what I'm trying to achieve.

https://drive.google.com/file/d/1Cuq5N5 ... sp=sharing

Image

Irrgod:
Image

On older CPUs, it is preferable to use goto in combination with labels as values for lower latency, since loops such as for or while have recurring branch misspredictions, using bitwise operators, two's complement, and bit masks instead of conditions that are prone to branch misspredictions on older CPUs (basically before 2011).. However, on modern CPUs, it is much more advisable to use for or while, as they are better optimized for that pipeline. In fact, goto and labels as values cause unpredictable jumps in certain contexts for modern CPUs, as they are better optimized for loops to be cached and predicted.
https://www.quora.com/Is-branchless-pro ... real-thing
C++ Crash Course: A Fast-Paced Introduction wrote:This greatly enhanced the ability for library writers to write generic code that would be able to handle arbitrarily complex deductions, which was unlike anything other languages in existence at the time could do. A final complication was that while C++98 was good, many compilers were not suited for implementing templates. The two major compilers of
the time, GNU GCC 2.7 and Microsoft Visual C++ 6.0, were both unable to do a two-step name lookup required by templates. The only way to fully get this right was to do a full compiler rewrite. . .

GNU tried to keep adding onto its existing code base, but finally went for a rewrite around the 2.95 time frame. This meant that there were no new features or releases for a multi-year period, and many were unhappy with this. Some companies took the code base and tried to continue its development, creating 2.95.2, 2.95.3 and 2.96—all three of which are remembered for their lack of stability. Finally, the completed rewrite GCC 3.0 came out.

It was not very successful initially, because while it would compile templates and C++ code much better than 2.95 ever did, it would not compile the Linux kernel to a working binary. The Linux community plainly objected to modifying their code to adapt to the new compiler, insisting that the compiler was broken. Eventually, around the 3.2 timeframe, the Linux community came around and the Linux world recentered around GCC 3.2 and up.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
Post Reply