-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support libdxcompiler.so on Linux (#5)
* Type include_handler as *const IDxcIncludeHandler instead of c_void * os: Add BSTR type on non-Windows * lib: Fix bitflags macro include extern crate requires deprecated `#[macro_use]`, which should be replaced with `use` instead. * Make intellisense compile on Linux * [LINUX ONLY] intellisense: Insert the usual destructor dummies * [WINDOWS] Make OS wrapper types compatible with Windows again HRESULT is 32-bit: https://en.wikipedia.org/wiki/HRESULT * Delete dummy functions (virtual dtors) again This assumes a DXC compiled without virtual destructor! Which - as it stands - is invalid with undefined behaviour, but "works". This needs followup in DXC itself. This includes a revert of commit 308dd86. * [WIN/LINUX] Implement vtable dummies (virtual dtors) through extra trait TODO: Might as well keep the IUnknown name and "hide" the COM one (less changes, as long as the right one is use'd. * [LINUX] wrapper: Library is in PWD * Add error type * Fix return type of IDxcType::get_kind * ffi: Replace c_void with the respective interface type get_buffer_pointer returns a mutable (non-const) void ptr, create_include_handler returns an IDxcIncludeHandler, and annotate some c_void types. All the remaining c_void uses are that way in the official API. * Cargo.toml: Only include winapi dependency on cfg(windows) Using winapi on not(windows) is a no-op already, but saves pulling in this extra dependency. * [LINUX] Disable DXIL validation at compile-time * README: Mention libdxcompiler.so requirement on Linux * Improve error handling * Add more context about the .dll / .so we're trying to load * Expose helper on Linux as well even though it always returns an error, makes the API slightly easier to use Co-authored-by: Tomasz Stachowiak <h3@h3.gd> Co-authored-by: Jasper Bekkers <bekkers@gmail.com>
- Loading branch information
1 parent
04a9508
commit 94fbad7
Showing
13 changed files
with
376 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.