We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3350 - GL renderers don't need to flip rows after reading back pixels from the target texture
Summary: GL renderers don't need to flip rows after reading back pixels from the targe...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-28 20:13 UTC by Simon Hug
Modified: 2016-10-01 18:34 UTC (History)
0 users

See Also:


Attachments
Patch that fixes upside down target textures when using ReadPixels and GL renderers. (5.42 KB, patch)
2016-05-28 20:13 UTC, Simon Hug
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Hug 2016-05-28 20:13:46 UTC
Created attachment 2472 [details]
Patch that fixes upside down target textures when using ReadPixels and GL renderers.

All OpenGL renderers always flip the rows of the pixels that come from glReadPixels. This is unnecessary for target textures since these are already top down.

Also, the rect->y value can be used directly for target textures for the same reason. I don't see any code that would handle the logical render size for target textures. Or am I missing something?

The attached patch makes the renderers only the flip rows if the data comes from the default framebuffer.
Comment 1 Sam Lantinga 2016-10-01 18:34:23 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/b8ca95a8eea9