-
Notifications
You must be signed in to change notification settings - Fork 92
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
Support for dummy output (no-op APIs) mode? #318
Comments
Interesting idea. Though I am not sure how much performance improvement this would actually give you. If the game engine loads DirectSound, for example, but does nothing with it because the game is using XAudio then I doubt there wold be much saved by simply giving the game engine an empty stub instead of the DirectSound APIs. |
It's not just about performance, but also about decoupling from unnecessary dependencies. For example, GameMaker has a bad habit of showing a warning messagebox if it fails to initialize DirectSound, which blocks further loading and requires user interaction. As you can imagine, this complicates the automation of restarts, which is critical in the case of dedicated servers. |
I see. And what would cause it to fail? If there a no sound cards in the device? I could consider making an option for creating an empty DirectSound wrapper option, because that is a real problem with dedicated servers. |
Yes, that's literally one of the reasons. |
Understood. Adding a dummy wrapper for DirectSound, for these cases makes sense. However, I am not sure it has much value to make a dummy wrapper for all DirectX interfaces (DirectInput, DirectDraw, Direct3D7, Direct3D8, Direct3D9, Direct3D10, etc.). |
It does IMO, because in GameMaker, for example, if something goes wrong on the initialization of Direct3D or DirectInput, then not only the same thing happens as with DirectSound (a modal window is displayed), but also the application aborts itself, even if input and display are in fact provided by other means (for example, WinAPI). This is why I originally proposed the ability of having four different methods of stubs in the request - GameMaker is just one example that I'm aware of, while others may employ more or less strict error handling semantics. |
Another benefit is that it would allow running games you previously couldn't without having an active Mesa and an Xorg server installed for the sole purpose of running the said game. |
Actually, in cher-nov's case DirectSound failing doesn't make a huge As for the Direct3D, you can obviously close the window too, but the |
Today I've came upon another use case for this feature: to avoid D3D device losses. For example, in the case of GameMaker they require considerable time to overcome, and versions from 8.1.141 to 8.1.218 could even crash on this (see this patch: |
Many older games used engines like GameMaker, which did not allow the developer to opt-out of graphics and/or audio output, but was also extensible. This led to cute situations where entire full-fledged tools were built on such engines using only system APIs, because this allowed the main game code to be reused and shared. However, such programs were still forced to waste resources on running subsystems they didn't need. One obvious example here is dedicated servers.
What would be nice to see is the ability to turn off actual output (activity imitation) in the following different ways:
D3DDEVTYPE_NULLREF
and its associated semantics in all corresponding functions instead of actual values.This would make it possible to obtain greater performance in such applications, as well as make them independent of real hardware configurations and contexts unfriendly to DirectX (for example, running in Wine).
The text was updated successfully, but these errors were encountered: