On Thu Jan 11 06:45:47 2024 +0000, Brendan McGrath wrote:
You're right. I did have the #ifdefs in at one stage, but I thought (in theory at least) we could run in to the same issue with the other architectures. So I removed them. Even though I had a test app that (when compiled as PE32+) worked fine. I didn't immediately understand why that was tbh. But I just took a look at the generated machine code for the 64-bit `d2d1.dll` and learnt that x64 does floating point different to x86 (it's not using the x87 instruction set). I also just checked the debug when running the PE32+ test app and it seems to show the calls to `_controlfp` are a no-op anyway. So I've put those #ifdefs back.
Does it mean we'll have different behaviour and fp results on i386 vs the rest? This is probably fine as workaround, but my ultimate solution would be to use similar logic from WPF, that was even worked on at some point by @cmcadams. It's obviously a massive change, should it ever happen.