# SDL\_RenderPresent software renderer

**URL:** <https://discourse.libsdl.org/t/sdl-renderpresent-software-renderer/21580>\
**Category:** SDL Development\
**Created:** [October 30, 2015, 5:36pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-software-renderer/21580 "2015-10-30T17:36:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcel\_Bakker](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@Marcel\_Bakker](https://discourse.libsdl.org/u/Marcel_Bakker)\
**Post date:** [October 30, 2015, 5:36pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-software-renderer/21580/1 "2015-10-30T17:36:02Z")

</div>

Hello, a question on the software renderer

As explained on the wiki [https://wiki.libsdl.org/SDL\_RenderPresent](https://wiki.libsdl.org/SDL_RenderPresent) :

> The backbuffer should be considered invalidated after each present  
> , do not assume that previous contents will exist between frames.

Is this also true for the software renderer ?

Thanks.

---

<div class="post-metadata">

**Author:** ![Sik\_the\_hedgehog](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/db5fbb/32.png) [@Sik\_the\_hedgehog](https://discourse.libsdl.org/u/Sik_the_hedgehog)\
**Post date:** [October 31, 2015, 5:04pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-software-renderer/21580/2 "2015-10-31T17:04:25Z")

</div>

Probably not, but I’d say you should still treat it like so  
(especially since there’s no reason to make your code _rely_ on using  
a given renderer under normal circumstances, the whole point is to  
avoid making assumptions).

Any reason for making your code rely on the software renderer quirks  
and explicitly refuse to use the hardware accelerated ones when  
available?

---

<div class="post-metadata">

**Author:** ![JonnyD](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/jonnyd/32/1604_2.png) [@JonnyD](https://discourse.libsdl.org/u/JonnyD)\
**Post date:** [October 31, 2015, 5:10pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-software-renderer/21580/3 "2015-10-31T17:10:01Z")

</div>

Also, since the software renderer doesn’t explicitly specify this behavior,  
there’s no reason it couldn’t change in the future and invalidate your  
code’s assumptions.

Jonny DOn Sat, Oct 31, 2015 at 1:04 PM, Sik the hedgehog \< sik.the.hedgehog at [gmail.com](http://gmail.com)\> wrote:

> Probably not, but I’d say you should still treat it like so  
> (especially since there’s no reason to make your code _rely_ on using  
> a given renderer under normal circumstances, the whole point is to  
> avoid making assumptions).
> 
> Any reason for making your code rely on the software renderer quirks  
> and explicitly refuse to use the hardware accelerated ones when  
> available?
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Marcel\_Bakker](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@Marcel\_Bakker](https://discourse.libsdl.org/u/Marcel_Bakker)\
**Post date:** [November 1, 2015, 1:41pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-software-renderer/21580/4 "2015-11-01T13:41:17Z")

</div>

Hello,

I am not refusing hardware renderers, also have no real need for this  
, just exploring SDL’s options.

While testing the software renderer i noticed this little ‘quirk’  
, and if was true, this could reduce memory load and blits in my project.  
Assuming people who are (forced?) using the software renderer are on low  
end \ embedded \ weird machines…  
, this could benefit SDL-users targeting such systems.

I can also understand why this quirk might be best left alone  
, it is not compliant with the spirit of SDL2.

2015-10-31 18:04 GMT+01:00 Sik the hedgehog \<sik.the.hedgehog at [gmail.com](http://gmail.com)\>:\> Probably not, but I’d say you should still treat it like so

> (especially since there’s no reason to make your code _rely_ on using  
> a given renderer under normal circumstances, the whole point is to  
> avoid making assumptions).
> 
> Any reason for making your code rely on the software renderer quirks  
> and explicitly refuse to use the hardware accelerated ones when  
> available?
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Sik\_the\_hedgehog](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/db5fbb/32.png) [@Sik\_the\_hedgehog](https://discourse.libsdl.org/u/Sik_the_hedgehog)\
**Post date:** [November 1, 2015, 2:24pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-software-renderer/21580/5 "2015-11-01T14:24:37Z")

</div>

2015-11-01 10:41 GMT-03:00, Marcel Bakker \<mna.bakker at [gmail.com](http://gmail.com)\>:

> While testing the software renderer i noticed this little ‘quirk’  
> , and if was true, this could reduce memory load and blits in my project.

I can see how it’d reduce blits (at least until you have fullscreen  
scrolling :P) but how would that reduce the memory load?

> Assuming people who are (forced?) using the software renderer are on low  
> end \ embedded \ weird machines…

Some magnifiers don’t play nice with GPU-rendered images for whatever  
reason (for users with those, the only option that works is the  
software renderer), so it doesn’t have to be low end, just a  
compatibility issue. This is why Sol lets you force using the software  
renderer.

Now mind you, I’d argue that rendering to a smaller texture and  
scaling up the final result could be way more helpful - some more  
memory usage, but a lot less of pixels to render. The biggest downside  
is that it’ll look blocky, but oh well 😛 (when speed is more  
important than accuracy, you’ll be OK with this)

---

<div class="post-metadata">

**Author:** ![Marcel\_Bakker](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@Marcel\_Bakker](https://discourse.libsdl.org/u/Marcel_Bakker)\
**Post date:** [November 1, 2015, 3:44pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-software-renderer/21580/6 "2015-11-01T15:44:20Z")

</div>

> I can see how it’d reduce blits (at least until you have fullscreen  
> scrolling :P) but how would that reduce the memory load?

In my case this an offscreen with dirty rectangles  
, i could evade the allocation and full-screen software blit for the  
offscreen.

> Some magnifiers don’t play nice with GPU-rendered images for whatever  
> reason (for users with those, the only option that works is the  
> software renderer), so it doesn’t have to be low end, just a  
> compatibility issue. This is why Sol lets you force using the software  
> renderer.

> Now mind you, I’d argue that rendering to a smaller texture and  
> scaling up the final result could be way more helpful - some more  
> memory usage, but a lot less of pixels to render. The biggest downside  
> is that it’ll look blocky, but oh well 😛 (when speed is more  
> important than accuracy, you’ll be OK with this)

Informative, thanks.
