This update will cache AdapterModes to reduce number of Direct3D9 API calls. This solves major performance issue on startup when using WineD3D. See issue #24.
The issue was that for each call to EnumAdapterModes d3d8to9 would make multiple calls to GetAdapterModeCount. This would multiply the number of API calls significantly. Furthermore, it seems there is a slight delay for each of these API calls when using WineD3D. Calling them only once and caching the results significantly improves the performance.
This update will make is to that when a Direct3D8 device is created it will enum all adapter modes and store them in a vector. Then when the game calls EnumAdapterModes it will retrieve them from the vector.
This update will cache AdapterModes to reduce number of Direct3D9 API calls. This solves major performance issue on startup when using WineD3D. See issue #24.
The issue was that for each call to
EnumAdapterModes
d3d8to9 would make multiple calls toGetAdapterModeCount
. This would multiply the number of API calls significantly. Furthermore, it seems there is a slight delay for each of these API calls when using WineD3D. Calling them only once and caching the results significantly improves the performance.This update will make is to that when a Direct3D8 device is created it will enum all adapter modes and store them in a vector. Then when the game calls
EnumAdapterModes
it will retrieve them from the vector.