STEAM GROUP
Special K - "Kaldaien's Mod" Special☆K
STEAM GROUP
Special K - "Kaldaien's Mod" Special☆K
529
IN-GAME
3,472
ONLINE
Founded
May 23, 2016
Language
English
All Discussions > Development > Topic Details
LeRaldo Mar 7, 2019 @ 3:36pm
Graphics Questions Unrelated to Special K
I was hoping Kaldaien could answer some Windows graphics questions for me unrelated to Special K. If this isn't allowed, sorry, please delete it.

Counter-Strike: Global Offensive just recently had an update which seems related to this https://docs.microsoft.com/en-us/windows/desktop/direct3darticles/direct3d-9ex-improvements

Added an optional -d3d9ex command line switch to reduce CPU memory use by about 40%. If you encounter graphics problems with this feature, please send an email to CSGOTeamFeedback@valvesoftware.com with the subject “D3D9EX”.

My questions are, will using the -d3d9ex launch option add input delay when compared to the previous full-screen exclusive mode with vsync off? Since it's involved with the DWM, does that mean that mean using -d3d9ex is functionally equivalent to using vsync, even if it doesn't actually limit the framerate of the game like vsync normally does? Basically, is it similar to running windowed full-screen?

Thanks.
< >
Showing 1-6 of 6 comments
Aemony Mar 7, 2019 @ 5:13pm 
D3D9Ex is an improved mode to use in borderless fullscreen windowed scenarios. Based on the below video from Microsoft, the basic of this mode (Windowed Flip) have a minimum latency of 1+ frame with V-Sync Off, and 3- (or 2-) with V-Sync On. It's possible it have even less latency on newer versions of Windows where Microsoft have added support for more powerful flip models, although I am not aware if these extends to D3D9Ex.

https://youtu.be/E3wTajGZOsA?t=245
Generally speaking though, windowed modes typically have at least a frame additional input latency compared to fullscreen mode, although I believe even this can be negated in DirectX 11 by allowing screen tearing in windowed mode.

Hopefully Kaldaien will be able to provide a better answer :)
Last edited by Aemony; Mar 7, 2019 @ 5:13pm
Kaldaien Mar 7, 2019 @ 5:32pm 
D3D9 Ex actually eliminates a memory copy that normally adds 1 frame of latency in windowed mode (in regular D3D9 in windowed mode on Windows Vista+, the game holds its finished frame until the desktop decides to repaint all windows and then a copy is performed by the DWM). D3D9Ex can draw directly into the desktop's memory, but you're going to need a fullscreen window for this to not violate the laws of physics on Windows ;)


That's why memory reduction is reduced, and it also reduces latency. It's great stuff that benefits both ways and has no real drawbacks aside from possible wonky driver support and from the benefits evaporating if the window isn't covering the entire screen or if the output image requires any form of scaling.
Last edited by Kaldaien; Mar 7, 2019 @ 5:36pm
LeRaldo Mar 7, 2019 @ 5:34pm 
Excellent, thank you both.

Edit: With regards to

It's great stuff that benefits both ways and has no real drawbacks aside from possible wonky driver support and from the benefits evaporating if the window isn't covering the entire screen or if the output image requires any form of scaling.

Does that mean if you say, have dual monitors (and play the game on only one monitor) that the benefits go away? And for another example, let's say your monitor's native res is 2560x1440 and you play at 1024x768, and use GPU scaling override instead of display, that it would go away in this instance as well?
Last edited by LeRaldo; Mar 7, 2019 @ 5:42pm
Kaldaien Mar 7, 2019 @ 5:46pm 
Oh, one other thing slipped my mind.

D3D9Ex got rid of the D3D9 "managed" memory pool. This used to be the default way that engines stored textures in graphics memory, it involved the graphics driver keeping a copy of any textures in BOTH system memory and in VRAM. The driver would take care of putting textures back into VRAM after an event like going to sleep and resuming (since VRAM is completely empty once the GPU is powered down).

In D3D9Ex, the graphics engine is responsible entirely for this. There's no automatic copy in system memory and if the engine doesn't reload all of its textures after a computer wakes from sleep, the game crashes. That's also why memory is reduced :)
Kaldaien Mar 7, 2019 @ 5:49pm 
Originally posted by LeRaldo:
Excellent, thank you both.

Edit: With regards to

It's great stuff that benefits both ways and has no real drawbacks aside from possible wonky driver support and from the benefits evaporating if the window isn't covering the entire screen or if the output image requires any form of scaling.

Does that mean if you say, have dual monitors (and play the game on only one monitor) that the benefits go away? And for another example, let's say your monitor's native res is 2560x1440 and you play at 1024x768, and use GPU scaling override instead of display, that it would go away in this instance as well?
If you're only outputting to one screen it should be fine. Or if you have a window that covers both screens and the internal resolution of the game is exactly the same as both screens resolution combined.

It's really just the case where the image doesn't match the desktop resolution that's the problem. That re-introduces the memory copy that was eliminated because scaling needs to be done.
LeRaldo Mar 7, 2019 @ 6:03pm 
Interesting, thank you. I hope to see more of these kinds of updates since they dropped support for Windows XP.
< >
Showing 1-6 of 6 comments
Per page: 1530 50

All Discussions > Development > Topic Details