GLEW has two major problems:
- it always includes everything, there is no way to restrict the header to a specific GL version
- it is mostly broken with a core profile and only works if all sanity checks get switched off.
There was one issue preventing the previous 2.0 betas from running under GL 3.x: The lack of persistently mapped buffers.
For the dynamic light buffer today's changes take care of that problem.
For the vertex buffer there is no good workaround but we can use immediate mode render calls instead which have been reinstated.
To handle the current setup, the engine first tries to get a core profile context and checks for presence of GL 4.4 or the GL_ARB_buffer_storage extension.
If this fails the context is deleted again and a compatibility context retrieved which is then used for 'old style' rendering which does work on older GL versions.
This new version does not support GL 3.2 or lower, meaning that Intel GMA 3000 or lower is not supported. The reason for this is that the engine uses a few GL 3.3 features which are not present in the latest Intel driver.
In general the Intel GMA 3000 is far too weak, though, to run the demanding shader of GZDoom 2.x, so this is no real loss. Performance would be far from satisfying.
A command line option '-gl3' exists to force the fallback render path. On my Geforce 550Ti there's approx. 10% performance loss on this path.
- added a light preprocessing pass to the renderer so that a non-persistent buffer can be used with minimal mapping/unmapping. This only gets used if necessary because it adds some overhead to the renderer.
When this function was originally written there was no possibility of fractional vertex coordinates so it threw away the fractional parts of the node's directional vector (which in the original nodes was always 0.)
Now, with UDMF and high precision vertices this no longer works and the loss of significant parts of their value caused this code to produce erroneous results if the linedefs were only a few map units long and using fractional positions.
- In ZDoom the timer runs a bit too fast because roundoff errors make 35 tics only last 0.98 seconds. None of the internal timing has been changed, only the places where a time value is printed it will get adjusted for this discrepancy.
- specie: money in the form of coins rather than notes
- species: a group of living organisms consisting of similar individuals
capable of exchanging genes or interbreeding
- cx1, cx2, cy1, and cy2 are not used anywhere, so get rid of them.
- Also annotated the comments to indicate the corresponding arrays in the Build engine.
because they're kind of a pain to type when all uppercase.
- Also, make its sx1 and sx2 members shorts, so it takes less space, since
it's getting crammed into a vissprite now.
- This still doesn't use all the sprite properties correctly. It also
looks like they're going to need different code to build the clipping
arrays. But at least wall sprites are drawn at the proper angle now!
Sadly, anything else makes no sense.
All the recently made changes live or die, depending on this extension's presence.
Without it, there are major performance issues with the buffer uploads. All of the traditional buffer upload methods are without exception horrendously slow, especially in the context of a Doom engine where frequent small updates are required.
It could be solved with a complete restructuring of the engine, of course, but that's hardly worth the effort, considering it's only for legacy hardware whose market share will inevitably shrink considerably over the next years.
And even then, under the best circumstances I'd still get the same performance as the old immediate mode renderer in GZDoom 1.x and still couldn't implement the additions I'd like to make.
So, since I need to keep GZDoom 1.x around anyway for older GL 2.x hardware, it may as well serve for 3.x hardware, too. It's certainly less work than constantly trying to find workarounds for the older hardware's limitations that cost more time than working on future-proofing the engine.
This new, trimmed down 4.x renderer runs on a core profile configuration and uses persistently mapped buffers for nearly everything that is getting transferred to the GPU. (The global uniforms are still being used as such but they'll be phased out after the first beta release.
- R_AddLine() and R_RenderDecal() had nearly identical code for setting up
texture mapping. These have now been spun off into methods of
FWallCoords and FWallTmapVals.