-
Notifications
You must be signed in to change notification settings - Fork 3
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
Experimenting with sharing DirectX textures #74
Conversation
space928
commented
Oct 25, 2023
- Added HookD3D and CreateTexture methods to OmsiHookInvoker and related RPC classes
- These methods allow Omsi's own d3d context to be used to create new textures and get the shared handle from them to be used by another d3d context for writing
- Added HookD3D and CreateTexture methods to OmsiHookInvoker and related RPC classes - These methods allow Omsi's own d3d context to be used to create new textures and get the shared handle from them to be used by another d3d context for writing
- Fixed build issue with OmsiExtensionsCLI - Handle exceptions in CLI program - Added some demo code to fiddle with D3D textures - Theoretically Memory is now thread safe - Replaced AccessViolationException with custom exception - Added ReadMemoryObject as a factory for OmsiObjects with null checking - ReadMemoryObjArray now does null checking on items - ComplObjInst.ScriptTextures is now a MemArray - OmsiGlobals returns nulls where appropriate - Added experimental events to OmsiHook - Better exceptions for remote methods - Experimental async/multithreading support for RemoteMethods (currently broken)
- Fixed various bugs - Exposed Memory to the public when using debug builds - MemArray refactoring + fixes - Added some overloads to Memory for uint addresses - Memory allocation is now async - Updated classes to support async memory allocation - Rewrote much of OmsiRemoteMethods and the RPC plugin to support async calls - Updated assembly versions - D3D still doesn't work...
- Implemented UpdateSubresource in OmsiHookInvoker, OmsiHookRPC and OmsiHook - Removed shared resource support from create texture, it never would have worked - Other small tweaks
- Fixed example code - Fixed WriteMemory(addr, T[]) buffer overrun - Exposed AllocRemoteMemory() - Added HRESULT enum for easier debugging of OmsiHookInvoker - Added many more sanity checks to DXHook.cpp - Added more bugs
- Dereference the newly created texture pointer correctly - Re-enabled script texture replacement - Added some animation to the texture modification example
- Removed dependency on SharpDX - Updated example program - Implemented new D3DTexture class - Improved memory writing methods to be allocation free - Added FreeRemoteMemory method - OmsiHook now automatically hooks d3d - Added new RPC methods - Fixed UpdateSubresource not copying enough bytes - Improved OmsiHookRPCPlugin logging - Fixed build system a bit, no longer depends on Omsi existing at the assumed path
/// <param name="address">the address of the existing texture</param> | ||
/// <exception cref="NullReferenceException"></exception> | ||
/// <exception cref="Exception"></exception> | ||
public async void CreateFromExisting(uint address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to have a test case for this in the CLI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but we'll leave that on the backlog for now.
//------------------------------------------------------------------------------------- | ||
// Returns bits-per-pixel for a given D3D9 format, or 0 on failure | ||
//------------------------------------------------------------------------------------- | ||
constexpr size_t DXHook::BitsPerPixel(D3DFORMAT fmt) noexcept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this not a copy of the switch from the other class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it mirrors the C# implementation, that is intentional.