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 2354 - [ES 2.0] SDL_RenderClear clears render target with wrong color
Summary: [ES 2.0] SDL_RenderClear clears render target with wrong color
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-19 15:28 UTC by ny00
Modified: 2014-02-09 09:49 UTC (History)
1 user (show)

See Also:


Attachments
Sample code (1.40 KB, text/x-csrc)
2014-01-19 15:28 UTC, ny00
Details
Fix for GLES2_RenderClear. (61.86 KB, text/plain)
2014-02-07 05:53 UTC, Seth Williams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ny00 2014-01-19 15:28:54 UTC
Created attachment 1525 [details]
Sample code

SDL_RenderClear clears a render target with the wrong color, if the opengles2 renderer driver is used and the target texture's format is SDL_PIXELFORMAT_ARGB8888.

The bug is *not* reproduced if SDL_PIXELFORMAT_ABGR8888 is used as the texture format (the first from the renderer's list).
It is further not reproduced using any of the following renderer drivers: opengl, opengles (apparently powered by Gallium3D), software.
Finally, the correct color can be drawn using SDL_RenderFillRect (instead of SDL_RenderClear).

A few details about the current setup:
- OS: Ubuntu 12.04 for x86_64
- GPU: GeForce GTX 460
- GPU driver version: 331.20-0ubuntu1~xedgers~precise1 (from the xorg-edgers PPA)
Comment 1 Seth Williams 2014-02-07 05:53:02 UTC
Created attachment 1551 [details]
Fix for GLES2_RenderClear.

Sam,

It appears that the clear just needs to take the render target format into consideration.

Seth.
Comment 2 Sam Lantinga 2014-02-09 09:49:53 UTC
Fixed, thanks guys!
http://hg.libsdl.org/SDL/rev/560c66a04082