Whenever the d3d device resets, RTs need to be re-rendered, but I can’t find any hook for this. Is there any way to tell if there has been a device reset?
I might be misreading, do you mean like when your GPU crashes? Or when you install new drivers? How the hell does that happen in the middle of a game, and the game just keeps running?
I don’t know all the causes of it, but changing resolution is one. It’s not a crash, its just the driver re-requesting all of the materials and stuff because it got reset.
I know for an annoying fact that there isn’t a “resolution changed” hook, and that devs who need it create it themselves by keeping track of ScrW/ScrH and watching them for changes.
hook.Add( “Initialize”, “Resolution Change”, function()
Base = "Panel", PerformLayout = function() hook.Run( "ResolutionChanged", ScrW(), ScrH() ) end } : ParentToHUD()
hook.Add( “ResolutionChanged”, “Resolution Change”, function( w, h )
print( "OH NO THE RESOLUTION CHANGED TO " … w … “x” … h )