Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REQ: Warn users about cvars that need texture reload to take effect #602

Closed
hemostx opened this issue Nov 11, 2021 · 2 comments
Closed

REQ: Warn users about cvars that need texture reload to take effect #602

hemostx opened this issue Nov 11, 2021 · 2 comments

Comments

@hemostx
Copy link
Contributor

hemostx commented Nov 11, 2021

Is your feature request related to a problem? Please describe.
This came up while investigating #601 (latching gl_no24bit not getting applied), where it appeared that some GFX variables which take effect with a vid_restart do not mention this in the console, as only CVARs registered with the CVAR_LATCH_GFX property warn the user in the console about needing a vid_restart.

Describe the solution you'd like
Treat the gl_vars that require a vid_restart as latching cvars to get the prompt and latching behavior.

These following cvars declared in r_texture_cvars.c fit this description:

  • gl_max_size
  • gl_miptexLevel
  • gl_picmip
  • gl_scaleModelTextures
  • gl_scaleModelSimpleTextures
  • gl_scaleTurbTextures
  • gl_scaleskytextures
  • gl_lerpimages //unsure about this one
  • gl_externalTextures_world
  • gl_externalTextures_bmodels

Caveats

  • I was looking around that area, so found some obvious "need restart" cvars I knew about. There may be others across other files that I'm missing entirely.
  • There are special cases on gl_max_size and gl_miptexlevel : they also need an OnChange action to warn about allowed texture sizes etc. and AFAICT it's one or the other in the cvar_t typedef (at least I failed to get both going naively :) ).
  • As-is, merely adding CVAR_LATCH_GFX in the initial cvar declaration gives the "vid_restart" warning, but the switch becomes ineffective. They also need to be pulled out of if (!host_initialized) {}.
    I have a partial patch which does this for the cvars I understand, know are latching and don't need to pick between a flag or OnChange

Describe alternatives you've considered
In terms of implementation, I'm not sure. Adding Com_printf("need vid_restart") in the OnChange actions feels like a dirty hack, because it is - we don't get the desired value latched when describing the cvar, nothing gets queued.

Impact on server or mods
There should not be :)

hemostx added a commit to hemostx/ezquake-source that referenced this issue Nov 11, 2021
This marks known gl_ cvars that require a vid restart as CVAR_LATCH_GFX, and moves them out of the !host_initialized check in R_TextureRegisterCvars.
- Doubts about gl_lerpimages commented in, marked as latch because *iirc* that's what it does
- Have not touched gl_max_size/gl_miptexlevel which give warning about adequate values in an OnChange action
@hemostx
Copy link
Contributor Author

hemostx commented Nov 11, 2021

Half-baked patch at hemostx@35586c4 - I haven't dared PR it

meag added a commit to meag/ezquake-source that referenced this issue Nov 14, 2021
For QW-Group#602, there's probably more cvars I'm sure
  hemostx can find.  Obviously very beta
Feels like we should fix no24bit setting console
  font as toggling back and fore is currently
  broken... other bugs with that though (QW-Group#605)
Adds CVAR_RELOAD_GFX cvar flag - if set, will show
  warning when it is changed, but value does change
  immediately.  Callbacks etc should be unaffected.
Adds `vid_reload` command, which reloads textures
  based on current settings.  This stops people
  doing vid_restart or having to reload the map
  after changing cvars which affect textures as
  they are loaded.
Adds `vid_reload_auto` cvar, if set then cvar
  change warning is suppressed and instead
  `vid_reload` will be issued prior to rendering
  the next frame.
Removed as latch cvars: `gl_no24bit`, `gl_wicked_luma_level`

Don't believe this should affect any rulesets, as
  any min/max/onchange logic is not affected, and
  vid_restart could be issued when connected
Needs testing, hence closing off alpha9 before this...
@meag meag changed the title REQ: mark graphics CVARs requiring a vid_restart as CVAR_LATCH_GFX REQ: Warn users about cvars that need texture reload to take effect Nov 14, 2021
meag added a commit that referenced this issue Nov 14, 2021
@meag
Copy link
Contributor

meag commented Jan 27, 2022

Closing, CVAR_RELOAD_GFX flag has been added

@meag meag closed this as completed Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants