Replaces the old freelist solution with the LevelPool, which
dramatically reduces the number of allocations needed for mobj and
precip sector assignment. In measurement, this cuts down the time taken
for spawning precipitation by 50%.
This should substantially reduce the number of malloc/free calls made to
create and destroy mobjs, especially during level load and net
save/load.
memory_resource standard header is not available on the OSX deployment
target we are using, so I had to write my own fixed size pool allocator.
This way when you pop a render pass, it will restore the previous
renderpass state if there was one. Allows for rendering code to enter
and leave the default render pass without interfering with other drawing
code.
The pipeline abstraction mimicked Vulkan and d3d12 explicit pipeline state objects
but, like GraphicsContext, was ill-considered for the kinds of drawing
behavior SRB2 uses. Rather than push this complexity into the drawing
code, it will instead be the responsibility of the backend to manage
explicit pipeline objects if necessary.
Now, drawing code must create a Program instance, bind it, and set the
rasterizer state to do the equivalent. Uniform, sampler, and vertex
attribute bindings are significantly simpler to set up now.
While this has an analog in Vulkan, it is trivial to manage vkRenderPass
on the backend side. We are already having to dynamically manage GL FBOs
for binding framebuffers for drawing in begin_render_pass, so I see
little reason to keep this object around.
This was already slated to be removed; the old PassManager was a failed
attempt to centralize and pipeline all graphics logic for a frame. Let's
remove it as a step towards simplifying some of this code.
I've come to the conclusion that some aspects of RHI are overengineered
to suit a future where we would theoretically support Vulkan with
minimal implementation effort. In an effort of architectural astronaut
engineering this has had the consequence of making much of the code
interacting with RHI significantly more complex.
The GraphicsContext was originally an opaque object to wrap and
contextualize operations that would eventually be inserted into a Vulkan
CommandBuffer for dispatch. In practice, for the GL backend, this does
nothing but introduce another pointer to pass around across all RHI
code, when it had already been previously accepted that the idea of
recording multiple GraphicsContexts at the same time was infeasible.
Thus, I'm choosing to excise GraphicsContext entirely. This doesn't do
much except remove passing around the context object. This is one of
many changes I would like to make that would simplify RHI-related code
and defer the complexity to the hypothetical future. Vulkan can come at
a later date, and we can solve the problems of Vulkan then. Right now, I
am actually more concerned for supporting a d3d9 renderer to shore up
that Intel 945GM laptop GPU support gap we currently have.
- TERRAIN index is +1 (it can write terrainOverlay at the same time, so there is the possibility of needing to archive NULL terrain).
-TERRAIN lookup is done immediately instead of at P_RelinkPointers (dunno why I did this, TERRAIN doesn't do mobjnum crap).
All values besides 0 and 1 have been unused for a while. Quite frankly, if the gamestate resend doesn't fix them, a rejoin won't either, so kicking them is just adding extra steps.
- dumpconsistency cvar is always enabled (rather than a define), but is now a cheat.
- It now dumps on resend, instead of on consistency failure kick. (Those don't even happen on too many resyncs anymore, anyways...)
- It now dumps for both the server & the client that is resyncing, so there's gamestates to compare. The two files are given names with metadata so they can be matched up.
It's not great, but it was easy enough to do and more useable than having 0 tools to inspect resync at all.
BEHAVIOR being optional is now handled from our side, because using getModule or loadModule on an invalid file is supposed to be an error condition for the VM.
This isn't an optimization for the mobj pointer list, but it is an
optimization for level interpolators, which previously made N
allocations for N non-mobj thinkers. Now those allocations are amortized
according to std::vector's storage.
This could still be further cleaned up to be more C++-ey.
I do not trust memcpy due to the rendering bug even though it appeared to mostly work, so I did it manually. It's still order of magnitudes faster than reloading the level from scratch.
- Use srb2::MobjList to keep checkpoint objects list
intact after savegame load
- Use std::unordered_map of line tag and vector of line_t
pointers
- Use line tag for the key so multiple checkpoints may
be associated to the same set of lines
Prints a full, ordered table of results, basically equivalent to intermission.
Much closer to the kind of logging one would want for tournament play, rather than the SRB2 leftover this command was holding previously.