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

Summary: [ES 2.0] SDL_RenderClear clears render target with wrong color
Product: SDL Reporter: ny00
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sawillms
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: Sample code
Fix for GLES2_RenderClear.

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