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 3363

Summary: Renderer viewport doesn't clip when opengles renderer uses glDrawTexfOES
Product: SDL Reporter: Simon Hug <chli.hug>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: All   
Attachments: Test case for viewport clipping with the opengles renderer.

Description Simon Hug 2016-06-17 14:56:35 UTC
Created attachment 2498 [details]
Test case for viewport clipping with the opengles renderer.

The description of the renderer viewport implies that everything outside the viewport rectangle gets clipped and all renderers implement it that way. There's an exception with the opengles renderer when it uses glDrawTexfOES. This operation does not use the vertex stage of the OpenGL pipeline where the vertices would get clipped to the view frustum and directly produces fragments.

Textures that overlap the viewport rectangle and get drawn with glDrawTexfOES do not get properly clipped.

Attached is a test case that shows this issue. The viewport is marked with a white rectangle and the overlapping textures with a yellow rectangle.
Comment 1 Simon Hug 2016-06-23 13:30:22 UTC
Mentioning bug 3373. It's not directly related, but be aware that the Raspberry Pi may do something unexpected with glDrawTexfOES.
Comment 2 Sam Lantinga 2016-10-01 17:47:25 UTC
I opted to remove that code path. Thanks!
https://hg.libsdl.org/SDL/rev/8e4a030053c2