Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOFT RENDERER: SDL_RenderCopyEx fails to draw when texture blend mode is enabled #1181

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.1
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2013-10-30 16:41:10 +0000, edubart wrote:

Nothing is drawn when using SDL_RenderCopyEx with SDL_BLENDMODE_BLEND enabled in the software renderer.

Code:
SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_BLEND);
SDL_RenderCopyEx(renderer, tex, src_rect, dest_rect, 0.1, NULL, SDL_FLIP_NONE);

However when setting blend mode to SDL_BLENDMODE_NONE it works. Also using SDL_RenderCopy with SDL_BLENDMODE_BLEND seems to work fine. Something is wrong in SDL_RenderCopyEx in the software renderer. I use SDL_RenderCopyEx for drawing rects with rotation.

On 2014-07-13 22:42:48 +0000, Melker Narikka wrote:

Created attachment 1751
a test case demonstrating the issue

Here's a test case demonstrating the issue.

On 2014-07-13 22:44:06 +0000, Melker Narikka wrote:

Created attachment 1752
RenderCopyEx patch

This patch seems to fix the issue.

On 2014-07-14 10:51:55 +0000, Melker Narikka wrote:

Created attachment 1754
RenderCopyEx patch - v2

A revised patch. Since the size of the rotated surface will always match the destination rectangle, we'll just unconditionally use BlitSurface.

On 2014-07-14 10:57:35 +0000, Melker Narikka wrote:

Created attachment 1755
rotateSurface - disable RLE acceleration

For some reason setting SDL_RLEACCEL (and thus using RLEAlphaBlit instead of SoftBlit) causes the render to fail. This only affects BlitSurface rather than BlitScaled, since BlitScaled seems to always use SoftBlit.

The normal RenderCopy doesn't set any RLE flags either, and winds up using SoftBlit.

On 2014-07-17 10:55:39 +0000, Damian Kaczmarek wrote:

Created attachment 1768
One pixel off at the edge

Any idea why this is caused? (attached screenshot) Is it a bug in the test case?

On 2014-07-17 11:33:28 +0000, Melker Narikka wrote:

(In reply to Damian Kaczmarek from comment # 5)

Created attachment 1768 [details]
One pixel off at the edge

Any idea why this is caused? (attached screenshot) Is it a bug in the test
case?

I think you meant to post that in # 2646 :)

In any case, that looks like a general issue with SDL_render.

On 2017-11-08 12:44:22 +0000, Sylvain wrote:

I tried with older version and it appears to be fixed between SDL 2.0.3 and 2.0.4. So marking as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant