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

BUG: toggling gl_no24bit at runtime has no effect, remains latched #601

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

BUG: toggling gl_no24bit at runtime has no effect, remains latched #601

hemostx opened this issue Nov 11, 2021 · 2 comments

Comments

@hemostx
Copy link
Contributor

hemostx commented Nov 11, 2021

ezQuake version:
3.6 since 015d762 (found by bisecting from 3.6a0 merge => HEAD)

OS/device including version:
W10 20H2, happens on either my desktop/GTX1070 or laptop/intel hd 4000, so probably irrelevant.

Describe the bug
From the console, changing gl_no24bit and doing a vid_restart has no effect. The cvar remains at its original value, with the desired value latched and not switched to.

Changing it in the config file works, but you can't toggle it at runtime.

ezquake.exe -no24bit works.

Toggling at runtime works in older 3.* releases, likely up to at least 3.5a24 (the last 3.5 binary I had lying around).

To Reproduce
Steps to reproduce the behavior:

  1. Make sure you have 24 bit textures in the qw filesystem and fire up ez 3.6, assuming the default gl_no24bit 0.
  2. gl_no24bit 1
  3. vid_restart
  4. Enjoy 24 bit textures.
  5. Check the cvar:
default 0
current 0
latched 1

Expected behavior
Same behavior as in older releases.

More details
Bisecting finds the guilty commit as 015d762

MINOR: Re-register fewer non-latch cvars on vid_restart

which essentially changes from

Cvar_SetCurrentGroup(CVAR_GROUP_TEXTURES);
...
Cvar_Register(&gl_no24bit);
...
// latch cvars
Cvar_Register(&gl_wicked_luma_level);

to

if (!host_initialized) {
    Cvar_SetCurrentGroup(CVAR_GROUP_TEXTURES);
    ...
    Cvar_Register(&gl_no24bit);
    ...
}
// latch cvars
	Cvar_Register(&gl_wicked_luma_level);

It would be tempting to pull registering that cvar_register out, however the issue appears to be the combination of this check with CVAR_LATCH_GFX.

When changed, CVARS with CVAR_LATCH_GFX show the helpful "xyz requires a vid_restart to take effect", which I suppose would be appropriate to add to several of the texture cvars in that group : gl_picmip, gl_miptexlevel, gl_external*, as those do indeed require a vid_restart to take effect, but the user has to figure that themselves.

So just for kicks, on HEAD, I disabled latching on gl_no24bit in r_textures_cvars.c:
cvar_t gl_no24bit = { "gl_no24bit", "0"/*, CVAR_LATCH_GFX*/ };
Toggling at runtime now doesn't say "requires a vid_restart", and switches as expected with a vid_restart.
I went further and added the property to gl_picmip:
cvar_t gl_picmip = { "gl_picmip", "0", CVAR_LATCH_GFX };
and after a rebuild, this now warns about "requires a vid_restart", and remains latched without applying the change.

Variables that would be affected by this:
gl_max_size, gl_scaleModelTextures, gl_scaleModelSimpleTextures, gl_mipmap_viewmodels, gl_scaleTurbTextures, gl_scaleskytextures, gl_miptexLevel, gl_no24bit, gl_picmip, gl_lerpimages, gl_externalTextures_world, gl_externalTextures_bmodels.

These are in fact latching and therefore should probably be flagged as such and pulled back out of that block. Now, doing that causes issues with QMB particles when toggling gl_no24bit (turning off = revert back to stock particles as expected, turning on = either missing/partial QMB effects, or a client crash when starting a QMB effect).

Note: special cases on gl_max_size and gl_miptexlevel which should be latching and need an OnChange to warn about allowed texture sizes etc.

@meag meag closed this as completed in 7226e2e Nov 11, 2021
@meag
Copy link
Contributor

meag commented Nov 11, 2021

Hi hemo - appreciate you've mentioned other issues at the bottom here, commit only fixes the bug. Can you create REQ for the other cvars, and we'll look at splitting /vid_restart from /vid_reload, which would reload textures only and not just create new window/opengl-context etc?

@hemostx
Copy link
Contributor Author

hemostx commented Nov 11, 2021

Here's the REQ. I'll try to get more intel on the QMB issues I stumbled upon for an other issue.

meag added a commit to meag/ezquake-source that referenced this issue Nov 14, 2021
### Changes from alpha8=>alpha9 (July 13th => November 14th, 2021)

- Fixed/worked around some classic renderer bugs on version x.y.13399 AMD drivers (QW-Group#416)
- Fixed bug causing off-by-one error when drawing rectangle outlines (3.5 bug, reported by Matrix, QW-Group#536)
- Fixed `/in_raw 0` behaviour on MacOS (QW-Group#489)
- Fixed `/r_drawflat 1`, `/r_drawflat_mode 0` affecting ammo boxes etc in classic renderer
- Fixed match logging not working when using competitive rulesets
- Fixed incomplete rendering when gibbed or dead in shallow water (reported by Matrix, QW-Group#568)
- Fixed tab key not switching tabs on serverinfo popup (reported by Hangtime, QW-Group#555)
- Fixed `/demo_jump_mark` not working if `/demo_jump_rewind` not set
- Fixed coping with 1x1 ibar.png (reported by Matrix, QW-Group#571)
- Fixed powerupshells when using `/r_viewmodelsize` (reported by timbergeron, QW-Group#573)
- Fixed crouch adjustment staying disabled after teleport/respawn when `/cl_nopred` enabled (reported by Matrix, QW-Group#572)
- Added `/gl_smoothmodels` back in (modern renderer only), (requested by Repast via [quakeworld.nu](https://www.quakeworld.nu/forum/topic/7508/why-is-the-command-glsmoothmodels-r))
- Added `/demo_jump_skip_messages` to determine if messages should be printed to console during demo jump
- Added `/demo_jump_end` to jump to next intermission point or end of demo (requested by Hangtime, QW-Group#564)
- Added `/sb_info_filter` to allow filtering of servers in server-browser based on serverinfo (requested by Matrix, QW-Group#537)
- On startup (after `autoexec.cfg` executed), a `vid_restart`/`s_restart` will be issued if any latched variables were changed (reported by Dusty, QW-Group#458)
- Multiview will be disabled when watching a solo demo and no powerup cams are active (requested by mmavova, QW-Group#126)
- MacOS: sets SDL flag to stop touch events being translated into mouse events (might help with QW-Group#354)
- `/status` command will be ignored if an alias with the same name is found, use `/sv_status` instead (fixes QW-Group#532)
- qw:// urls in command line will be opened even if not preceded by `+qwurl` (thanks to ciscon)
- Linux: register_qwurl_protocol will register protocol with xdg (thanks to ciscon)
- Added `/v_dlightcolor` to control if being inside flashblend light affects palette by color of light
- Added `/v_dlightcshiftpercent` to control strength of palette shift effect when inside flashblend light
- Changed `/v_dlightcshift` to be enum of when being inside flashblend light affects palette (requested by HangTime, QW-Group#542)
- Added `/vid_framebuffer_multisample` to control multi-sampling level of the framebuffer (reported by Matrix, QW-Group#367)
- Translucent models are first drawn with a z-pass, to stop overdraw affecting level of translucency
- Fixed explosion effects on md3 viewmodels (additive blending was being lost)
- Removed server-side weapon switching 'support' in client
- Removed debugging messages when using `+fire_ar`
- Commands that search by regular expression (`/cvarlist_re` etc) are now case-insensitive (reported by HangTime, QW-Group#599)
- Added `/fs_savegame_home` to control if games are saved to home directory (default) or game directory (reported by githubtefo, QW-Group#586)
- Fixed `/gl_no24bit` not taking effect after `/vid_restart` (reported by hemostx, QW-Group#601)
- Fixed `/gl_no24bit` not disabling loading external textures (3.5 bug, kind of reported by hemostx, QW-Group#601)
- Fixed bug causing `/gl_scaleskytextures` to not affect external textures (reported & fixed by hemostx, QW-Group#606)
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