Skip to content

Conversation

@notimaginative
Copy link
Contributor

Fixes several issues related to changing the 3D Hardware Textures detail slider:

  1. Fix bug with mipmap based resizing of uncompressed textures that would result in texture corruption and invalid memory reads if the default slider wasn't at max level.

  2. Prevent changing of the detail slider from affecting an active mission. A active mission will have to be restarted for the changes to take affect.

  3. Fix various issues with handling of render targets, specifically with regards to proper cleanup and recovering from tcache being flushed during mission restart.

The if statement wouldn't trigger as defined which caused the incorrect data offsets to be
used. This resulted in corrupted textures and invalid memory reads.
In the case of an error tcache_set does not set it's output variables which
can lead to issues with error handling. So set the those variables to sane
defaults early on in case of failure.
Render targets are invalidated after tcache_flush is called so give the ability to detect that
so that the render target can be recreated as required.
@notimaginative notimaginative added fix A fix for bugs, not-a-bugs, and/or regressions. graphics A feature or issue related to graphics (2d and 3d) labels Jul 23, 2025
@notimaginative
Copy link
Contributor Author

notimaginative commented Jul 23, 2025

Setting as draft in order to get comments on changing of the hardware texture detail slider. I believe I've accounted for all normal operations of FSO code, however that doesn't really help in the case of render targets created through scripting. As such, it may be necessary to prevent that detail slider from taking affect until a full restart of the engine. I believe that would be the preferred way of handling it for @BMagnu. Perhaps also adding a popup notice that the slider does nothing until full restart.

Also these individual commits could be separated into other PRs if that's preferred for one or more of the bug fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions. graphics A feature or issue related to graphics (2d and 3d)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant