NUKE glconfig_t, use WindowConfig instead - #1753
Conversation
|
Other information about the renderer setup is potentially interesting to the cgame besides the window information. Stuff in there might be used to disable incompatible effects or fall back on alternative ones. For example there is the buildable range intersection feature which doesn't work if there is a float color buffer. Or the cgame might refrain from sending add light IPCs if dynamic lights are disabled. |
I think it's better to put those in a different struct that would just contain the information on rendering feature availability. Such struct could also contain information on whether a given feature can be enabled and what is required for it (so e. g. the normal mapping option would be greyed out and would show that normal mapping is required if the latter is disabled). |
|
Also, none of the features mentioned are in the |
|
In fact, we can have an std::vector of the supported rendering features in both cgame and engine. Each element would be something like: and there would be an enum corresponding to each one (to keep strings translatable in the graphics settings). Then, if cgame receives a vector with more features than it's aware of, it would simply ignore the extra ones and perhaps print their names into the log. If the engine sends a vector with less features, the extra ones would be implicitly disabled, perhaps with some log print about those features requiring a newer engine version. All of that would allow adding support for optional rendering features that require adding extra codepaths in cgame. For example, GPU particles could be an option that, if detected to be enabled in the engine, would be used by an up-to-date cgame, or otherwise just ignored. |
|
Or just keep it as a fixed-size array. That would be simpler, but would require a major engine release to add anything new to it. |
|
Having a vector instead of the fixed-size struct sounds like a good idea. I guess |
69d2fe1 to
641563e
Compare
I was thinking more so just referencing the other |
|
Allowing strings would be nice since if you update things without a new major release, the cgame can fall back on displaying the string verbatim if there is a feature it doesn't know about. A feature requirement item could be a pair of an |
That sounds good. |
slipher
left a comment
There was a problem hiding this comment.
The general idea seems fine, but I'm afraid that with the way the PR is structured now, the for-0.56 branch will be constantly broken, since each time a line of code referencing glConfig or glConfig2 is edited on master, it will fail to merge or fail to compile once merged. So it would be better to arrange the changes so that we do the large-scale renaming on master now. For example you could remove glconfig_t from the renderer and only build it for IPC, while adding and using WindowConfig in the renderer. Or you could rename glconfig_t to WindowConfig right now in the engine and cgame, and just remove the extra fields on 0.56.
Good point. I've moved most of the changes to #1764, so this pr will only need to move |
|
The part for the master branch was merged so this now needs a rebase. |
641563e to
f3c7655
Compare
|
Rebased. |
f3c7655 to
4356b5b
Compare
|
CI failure is unrelated:
|
d4b83e4 to
b9d9993
Compare
Move the stuff actually used by cgame (window and display sizes and display aspect) to `WindowConfig`.
4356b5b to
4775d98
Compare
|
LGTM |
Cgame-side pr: Unvanquished/Unvanquished#3405
Fixes #517
Move the stuff actually used by cgame (window and display sizes and display aspect) to
WindowConfig. Merge the rest withglconfig2_tintoGLConfig.I've noticed this issue earlier when adding things to
glconfig2and when working on daemon-vulkan:RE_BeginRegistration()usesglconfig_t* glConfigOut, glconfig2_t glConfig2Outas its parameters, even though it only needs the window and display sizes from the first one and nothing else.