Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Loading textures take an unreasonable amount of VRAM  (Read 1225 times)

0 Members and 1 Guest are viewing this topic.

Liran

  • Newbie
  • *
  • Posts: 1
    • View Profile
Loading textures take an unreasonable amount of VRAM
« on: March 06, 2020, 02:54:15 am »
Hi

I am working with Windows 10, Visual Studio 2019, SFML 2.5.1 32bit and using GPU-Z to analyze the VRAM usage.

I am loading some sprites and spritesheets using sf::Texture::loadFromFile and while some of the smaller files <1MB  don't raise the VRAM usage too much, I tried loading 3 textures which produced a very high VRAM increase.

All are in PNG format.
1. 5MB texture raised the VRAM usage by 100+MB.
2. 3.3MB texture raised the VRAM usage by 450+MB.
2. 11.8MB texture raised the VRAM usage by about 600MB.

I would not be surprised by a bit of overhead but I am really confused by this.

Thank you

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Loading textures take an unreasonable amount of VRAM
« Reply #1 on: March 06, 2020, 07:52:21 am »
PNG has RLE compression (which is noticable if your image has long ranges of pixels with same color), that can explain a difference. There's also the bit depth: SFML uses 32-bits pixels, PNG can probably use lower, like 8-bit.

Can you give us the specs of your PNG files (width, height, bits per pixel)? Or better, upload one so that we can play with it directly.
Laurent Gomila - SFML developer

 

anything