Encapsulate Render State

Reporter: RobertBColton  |  Status: closed  |  Last Modified: September 10, 2020, 07:55:11 PM

It should be very obvious what I am doing here. I am moving all of the namespace enigma:: scoped render state to a struct whose type is RenderState and whose members are public by default. This completes the first part of the work detailed in #1681 that is necessary to add dirty tracking. By having all of the render state encapsulated in a struct, we can do things like push and pop states as well as serialize the state to targets other than a GPU, such as including it in the game_save serialization.

I am not exactly sure of the performance implications of this change, but haven't noticed any degradation in any benchmarks. I have done extensive regression testing to ensure there's been no relapse in correctness either.

@JoshDreamland I think we also need to begin considering now what type of state belongs in this struct, and what type doesn't. For example, there is "render" state, such as circle precision, which is used by the general graphics functions, but does NOT need to be known by the GPU. However, it may still be useful to include in a game_save serialization and thus could still go into the new struct.

>Codecov Report

Merging #1738 into master will not change coverage.
The diff coverage is 35.71%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1738   +/-   ##
  Coverage   24.77%   24.77%           
  Files         166      166           
  Lines       16588    16588           
  Hits         4109     4109           
  Misses      12479    12479
Impacted Files Coverage Δ
...NIGMAsystem/SHELL/Graphics_Systems/General/GSd3d.h 0% <ø> (ø) ⬆️
...system/SHELL/Graphics_Systems/General/GScurves.cpp 0.85% <0%> (ø) ⬆️
...ions/ParticleSystems/PS_particle_bridge_fallback.h 0% <0%> (ø) ⬆️
...system/SHELL/Graphics_Systems/General/GSstdraw.cpp 9.87% <12.5%> (ø) ⬆️
...GMAsystem/SHELL/Graphics_Systems/General/GSd3d.cpp 12.04% <17.39%> (ø) ⬆️
...system/SHELL/Graphics_Systems/General/GScolors.cpp 18.91% <30%> (ø) ⬆️
...system/SHELL/Graphics_Systems/General/GSscreen.cpp 58.82% <55.55%> (ø) ⬆️
...stem/SHELL/Graphics_Systems/General/GStextures.cpp 19.26% <58.33%> (ø) ⬆️
...GMAsystem/SHELL/Graphics_Systems/OpenGL1/GLd3d.cpp 50% <61.36%> (ø) ⬆️
...Asystem/SHELL/Graphics_Systems/General/GSblend.cpp 80% <66.66%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2d35ce...a38190d. Read the comment docs.

Please sign in to post comments, or you can view this issue on GitHub.