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 4960

Summary: Multiple viewports do not work on macOS
Product: SDL Reporter: Tom Hulton-Harrop <tom.hultonharrop>
Component: renderAssignee: Alex Szpakowski <amaranth72>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: kerndog73
Version: 2.0.10Keywords: target-2.0.12
Hardware: x86_64   
OS: macOS 10.15   
Attachments: Sample project that reproduces the issue (can be built with CMake)
Simplified test case

Description Tom Hulton-Harrop 2020-01-26 11:52:19 UTC
Created attachment 4177 [details]
Sample project that reproduces the issue (can be built with CMake)

When attempting to render to multiple viewports using SDL2 on macOS, only the first viewport set will be presented to the display.

This issue was originally reported to Rust-SDL2 (https://github.com/Rust-SDL2/rust-sdl2/issues/941#issuecomment-578493766) but after further investigation, it was found the issue reproduced with native SDL2.

When running the same example on Windows 10, multiple viewports are displayed correctly.

The issue can be reproduced using this example - https://lazyfoo.net/tutorials/SDL/09_the_viewport/index.php

I've attached a version of that tutorial with a CMakeLists.txt file to make building easier (please see the previously linked GitHub issue for relevant screenshots).

Thanks!


Tom
Comment 1 Tom Hulton-Harrop 2020-01-26 11:58:09 UTC
GitHub issue without issuecomment jump link - https://github.com/Rust-SDL2/rust-sdl2/issues/941
Comment 2 Indiana Kernick 2020-02-03 06:15:28 UTC
Created attachment 4185 [details]
Simplified test case

I added a simplified test case that doesn't depend on SDL_Image and checks errors for every call. I found that this is a problem with the Metal driver specifically. The OpenGL and software drivers work as expected so they can be used to workaround this issue.
Comment 3 Sam Lantinga 2020-02-03 08:52:55 UTC
Alex, can you look at this?
Comment 4 Sam Lantinga 2020-02-10 17:48:50 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/22308b7ba06c