| Summary: | Scaled texture draws with filtering produce wrapping artifacts. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Yuri K. Schlesner <yuriks> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | minor | ||
| Priority: | P2 | CC: | bugzilla.libsdl.org, rootfather |
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows 8 | ||
| Attachments: |
Testcase
Problem screenshot Proposed patch |
||
Created attachment 1158 [details] Problem screenshot (Note: the test program in the previous comment depends on bug #1874 to work properly.) If everybody is okay with enabling clamping on D3D, I think that's a good fix. It seems reasonable to have behavior parity between OpenGL and D3D as long as it doesn't cause other issues. Do you want to submit a patch? Created attachment 1164 [details]
Proposed patch
I'd like to ask you to verify that I did this state setting in the correct places. I'm not 100% on if there was a shared initialization function that I missed where I could be doing this instead.
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! Hi folks, I'm a contributor to the ScummVM project [http://scummvm.org]. We use SDL2 for some of the platforms we support, mainly the Windows, Linux and macOS ports. While testing, I noticed that this bug apparently still exists and that the proposed patch by Yuri Schlesner was not merged into the code base. Any chance to get this merged? Best regards rootfather I understand this is not a critical issue, and, it has had a patch available which seems to fix the problem for 4.5 years, and the patch is only four lines of code. Could it please be reviewed & landed? Thank you. Fixed, thanks! https://hg.libsdl.org/SDL/rev/0c134b939fd9 |
Created attachment 1157 [details] Testcase When using texture filtering, there are filtering artifacts visible on the edges of scaled textures, where the texture filtering pulls in texels from the other side of the texture. Using clamping texture modes wouldn't completely fix this since source rectangles don't need to cover the whole texture. (See screenshot attached in next post.) The opengl driver uses clamping on textures and so avoid this at least in the cases where the source rect is the whole texture. The direct3d driver does not and so has problems in every case. I'm not sure if it can actually completely be fixed, but at least enabling clamping for direct3d would be one step in the right direction. Attached is a testcase with a test pattern that illustrates the issue.