0

My question is: If you have consumed all the available video ram, and attempt to create a new texture (SDL), will normal ram be used automatically instead of video ram? Or, will you have to attempt to use a surface (SDL), which uses normal ram? In the event you are unable to free the video ram for use for whatever reason.

  • 1
    It is up to graphics driver, but even so - would it matter? You can't really feed surface to renderer without converting it to texture, so it wouldn't help. – keltar Mar 04 '17 at 12:22
  • @keltar you are right, you couldn't feed a surface to the renderer, but you can still draw a surface without a renderer. Good information about the fact it is up to the graphics driver though. I gave you an up-vote for it. –  Mar 04 '17 at 18:27
  • Yeah but if you draw without renderer - then there was no need for textures in the first place, and two don't combine, so I don't see how they cross. – keltar Mar 04 '17 at 18:31
  • @keltar it would require a bit of messing about. A possible work around would be create a new view port for the new surface I think, I haven't tested this though. –  Mar 04 '17 at 19:23

1 Answers1

0

Driver dependent, software renderer uses system memory obviously. GL based implementations use video memory, what happens when OpenGL runs out of memory is up to the driver, most likely it will end up in system memory.

Technically, you have no guarantee that there even is such a thing as video memory, OpenGL is just supposed to store it in the "most practical location", definition of that depends on the hardware (think hybrid memory, there is no difference in that case).

TL;DR; Yes, textures will be stored where there is space for them.

Casper Beyer
  • 2,203
  • 2
  • 22
  • 35