| Summary: | Wrong rotation for Direct3D11 renderer. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Martin Vee <martin.veronneau> |
| Component: | render | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | critical | ||
| Priority: | P2 | CC: | iryont, martin.veronneau |
| Version: | 2.0.10 | Keywords: | target-2.0.12 |
| Hardware: | x86_64 | ||
| OS: | Windows 10 | ||
| Attachments: |
Comparison of Direct3D renderers with rotated arrow pointing up.
Patch for SDL_render_d3d11.c to fix the rotation problem. |
||
|
Description
Martin Vee
2019-11-13 21:18:30 UTC
That problem was blocking the production here, so I lookde at the code in SDL_render_d3d11.c to try to debug it. I realized that the horizontal and vertical flip code in D3D11_QueueCopyEx() was reversed. I'm submitting a patch that works for us (see attached files). Please note that the patch also includes changes that are not necessarly important, but that brings the code closer to what the D3D_QueueCopyEx() function looks like. The relevant part, though, is the SDL_FLIP part at the beginning of the function. Created attachment 4063 [details]
Patch for SDL_render_d3d11.c to fix the rotation problem.
This patch is now https://hg.libsdl.org/SDL/rev/805a3b5cdcc8, thanks! --ryan. This fix actually made Direct3D11 renderer behave erratically with texture coordinates "jumping around". I haven't actually looked at what caused it exactly in texture coordinates, but since recently I was implementing SDL2 renderer into my game I've noticed that as soon as I updated to 2.0.11 from hg the renderer with Direct3D 11 driver behaves erratically while other drivers have no such issues. This is how texture coordinates behave: https://youtu.be/hIu01zdC8hc It renders normally in SDL 2.0.10 and I did confirm (by replacing SDL_render_d3d11.c in 2.0.11-hg from 2.0.10-stable) that this fix actually brought this behavior. My bad actually, I did incorrectly assume this was the issue since this patch was messing around with texture UV, but I had some time to check all commits and this one is actually fine. The one that caused the behavior was this one: https://hg.libsdl.org/SDL/rev/44b0a095f4b7 If I comment this line it works fine. I'm marking this one as resolved back again |