-
Notifications
You must be signed in to change notification settings - Fork 371
Assert when running on Windows ARM64 #790
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
Comments
I think I have a simpler repro with just imgui-sys v0.12 (can also be found in the use imgui_sys::{
igSetCurrentContext, igSetNextWindowPos, ImGuiCond_FirstUseEver, ImGuiContext, ImVec2,
};
fn main() {
// Dummy ImGuiContext
let mut bytes = vec![0u8; 1025];
let context = bytes.as_mut_ptr() as *mut ImGuiContext;
unsafe { igSetCurrentContext(context) };
// When you step through igSetNextWindowPos and follow it to the C++ side, you can
// see that pos, cond, and pivot have incorrect values. It may or not trigger the
// assert in ImGui::SetNextWindowPos depending on what cond becomes. On my machine,
// cond becomes 1025 (seemingly from vec size above) and triggers the assert.
let pos = ImVec2 { x: 200.0, y: 300.0 };
let cond = ImGuiCond_FirstUseEver; // 4
let pivot = ImVec2::zero();
unsafe { igSetNextWindowPos(pos, cond as i32, pivot) };
} |
The more I stare at this, the more I think this isn't an issue with imgui-rs or imgui-sys but rather a lower level issue. I opened a thread in the Rust user forums here: https://users.rust-lang.org/t/possible-code-generation-issue-on-windows-arm64/117580 |
@robmikh any luck in the exploration? |
Unfortunately, no. I decided to continue running x64 builds on my ARM64 machines for the time being, as the project I'm working on is something I do in my free time. |
Understood! I unfortunately don't have a windows ARM device. I suppose I could try cross compiling but I'm not sure that that wouldn't introduce any other issues |
Just for information, the exact same problem occurs with the programming language Crystal as well (which often uses the same ABI code as Rust) - and also only on ARM64 Windows. In the end, this actually might be some 5F8F error in the Rust/Crystal ABI code. |
Describe the bug
When setting the position of a window, the following assert is hit in imgui:
Here's the stack:
In the last Rust frame, the value of pos_cond is 4, but when crossing over to C++ the value becomes some large number. The position also seems wrong when crossing over to C++.
Does not repro on x64.
To Reproduce
I have a repro here: https://github.com/robmikh/imguiarm64repro
Run and then press enter to run the code that will hit the assert. If there's a null renderer to slim down the repro, please let me know.
Please describe your environment
The text was updated successfully, but these errors were encountered: