| Summary: | Direct3D renderer should set D3DCREATE_FPU_PRESERVE for not behaving vastly different on doubles (causes 3rd party lib crashes!) | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ellie <etc0de> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows (All) | ||
Any chance we can get this added soon? It's such a little change, yet meaning much e.g. to Lua applications (for which this bug is somewhat of a blocker). Fixed, thanks! http://hg.libsdl.org/SDL/rev/d4621a7e0faa |
Direct3D renderer should set D3DCREATE_FPU_PRESERVE for not behaving vastly different to OpenGL/software rendering on doubles and break some libraries really badly. Most notable affected example: Lua, which does the most unpredictable things which are really almost impossible to debug/find out for beginners who never heard this culprit exists. Since I believe all renderers should behave the same on that doubles simply work as expected in a program, this should really be changed! (also this wasted a few days of my life wondering why everything in my program was so broken) Please change src/render/direct3d/SDL_render_direct3d.c:441 from: result = IDirect3D9_CreateDevice(data->d3d, data->adapter, D3DDEVTYPE_HAL, pparams.hDeviceWindow, (caps. DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) ? D3DCREATE_HARDWARE_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING, &pparams, &data->device); to: result = IDirect3D9_CreateDevice(data->d3d, data->adapter, D3DDEVTYPE_HAL, pparams.hDeviceWindow, D3DCREATE_FPU_PRESERVE | ((caps. DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) ? D3DCREATE_HARDWARE_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING), &pparams, &data->device); Please note this currently makes any accelerated (non-software) SDL Texture renderers inoperable in Lua applications on some Windows configurations in combination with bug #1331 Of course there might be other ways to fix this I am not aware of, I am not a Windows/Direct3D guru. But if you can't think of any, please take this route soon.