| Summary: | SDL_BLENDMODE_BLEND not working properly for software renderer | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Damian Kaczmarek <rush> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | meklu |
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
Source coding showing the problem
software blending patch software blending patch - non-eaten version software blending patch - v2 Updated test code software blending patch - v3 |
||
I should also add that setting render mode does not fail. Great bug report, I'll look into it. Thanks! Created attachment 1743 [details]
software blending patch
Does this patch help?
Created attachment 1744 [details]
software blending patch - non-eaten version
Oops, bugzilla ate the patch headers :(
I applied the patch manually and it works! Thanks! There is still something wrong unfortunately. Good scene: http://x.rushbase.net/39f272c9c84d593a741e2319b4840fc2e57dc389/good.png Before patch scene: https://x.rushbase.net/54162d467147797f41a2a4e91279b470c2c7f154/dd14.png After patch scene: http://x.rushbase.net/82e3d2d6e88424313569eb2b9f921ac74c25c795/bad.png Created attachment 1745 [details]
software blending patch - v2
Here's an updated patch. Does it make a difference?
Created attachment 1746 [details]
Updated test code
Added a semi-transparent green rectangle being blended, again this shows different results from software and hardware renderers
Otherwise your latest patch fixes the most obvious problems, we're getting there! Good work. Created attachment 1747 [details]
software blending patch - v3
Okay, let's try that again, shall we? This one only touches the alpha, and seems to act right with the updated test case.
Seems to work perfectly, thank you! Does this work? sa = DRAW_MUL(inva, sa) + a; (In reply to Sam Lantinga from comment #12) > Does this work? > sa = DRAW_MUL(inva, sa) + a; v3 does just that :) Yeah, I just wanted to see if ordering mattered, for consistency with the previous lines. It works quite fine. Fixed, thanks! https://hg.libsdl.org/SDL/rev/515be38f3f37 |
Created attachment 1742 [details] Source coding showing the problem I attach a program showing the problem. g++ sdl2bug.cpp -lSDL2 && ./a.out Window on the right shows software renderer which is wrong Window on the left shows hardware renderer which is right I would also appreciate suggestions if there are possible workarounds