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 4457 - software renderer batch
Summary: software renderer batch
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.0
Hardware: x86 Windows 7
: P2 blocker
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.10
Depends on:
Blocks:
 
Reported: 2019-01-14 13:30 UTC by Marcel Bakker
Modified: 2019-06-11 18:13 UTC (History)
1 user (show)

See Also:


Attachments
example (1.90 KB, text/plain)
2019-01-14 13:30 UTC, Marcel Bakker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Bakker 2019-01-14 13:30:10 UTC
Created attachment 3573 [details]
example

I get a SDL_assert(viewport != NULL) when SDL_RenderPresent is called a second time.

example included
Comment 1 Ryan C. Gordon 2019-05-18 18:48:55 UTC
Tagging a bunch of bugs with "target-2.0.10" so we have a clear list of things to address before a 2.0.10 release.

Please note that "addressing" one of these bugs might mean deciding to defer on it until after 2.0.10, or resolving it as WONTFIX, etc. This is just here to tell us we should look at it carefully, and soon.

If you have new information or feedback on this issue, this is a good time to add it to the conversation, as we're likely to be paying attention to this specific report in the next few days/weeks.

Thanks!

--ryan.
Comment 2 Sam Lantinga 2019-06-09 01:13:26 UTC
Marking this a blocking bug for 2.0.10.
Comment 3 Sylvain 2019-06-10 13:41:17 UTC
https://hg.libsdl.org/SDL/annotate/4f015bc7cbb1/src/render/software/SDL_render_sw.c#l596

As the "assert" says, we may have no viewport there, but we can get it easily:

  viewport = &renderer->viewport;

It seems a correct way to remove the assert.



But there are another issue that is pointed by the test-case, the final clip_rect is wrong.

When the viewport hasn't been specified, it's added afterward as fullscreen.

https://hg.libsdl.org/SDL/annotate/4f015bc7cbb1/src/render/SDL_render.c#l488

So after the round 2, the user clip_rect gets ignored/overwritten because it's overwritten by the viewport ...
Comment 4 Ryan C. Gordon 2019-06-11 18:13:27 UTC
(In reply to Sylvain from comment #3)

> As the "assert" says, we may have no viewport there, but we can get it
> easily:
> 
>   viewport = &renderer->viewport;
> 
> It seems a correct way to remove the assert.

renderer->viewport is what the viewport is currently set to by the app, but not necessarily what it was set to at that point in the command queue, fwiw.

> But there are another issue that is pointed by the test-case, the final
> clip_rect is wrong.

Good catch!

The assert and this problem are both fixed now, in https://hg.libsdl.org/SDL/rev/32839175c0e4

The software renderer now tracks this state like the other renderers were already doing.

--ryan.