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

Author Topic: RenderTexture does not get destroyed properly when antialiasing is set  (Read 4601 times)

0 Members and 1 Guest are viewing this topic.

BTregit

  • Newbie
  • *
  • Posts: 2
    • View Profile
When RenderTexture is created inside member function with big size(5000, 1000) and antialiasing is set it deos not get destoryed correctly, i checked ram usage using Windows Task Manager.

SFML version: 2.5.1
Microsoft Visual Studio Community 2019 - Version 16.7.3
Debug x64


Includes:

#include "SFML/Graphics.hpp"
#include "Windows.h"


Here is test class with 2 tests:
test1 - antialiasing is turned on(4)
test2 - antialiasing is turned off(0)

class TestRenderTexture {
public:
        void test1() {
                sf::RenderTexture tex;
                tex.create(5000, 1000, sf::ContextSettings(0, 0, 4, 1, 1, 0, false));
                tex.clear(sf::Color::Transparent);
                tex.display();
        }
        void test2() {
                sf::RenderTexture tex;
                tex.create(5000, 1000, sf::ContextSettings(0, 0, 0, 1, 1, 0, false));
                tex.clear(sf::Color::Transparent);
                tex.display();
        }
};


My main:

int main() {
        TestRenderTexture test;
        test.test1(); // run test1 or test2 here

        sf::RenderWindow window(sf::VideoMode(1200, 675), "Test");

        //loop keeps program open
        while (window.isOpen()) {
                Sleep(400);
                sf::Event ev;
                while (window.pollEvent(ev)) {
                        if (ev.type == sf::Event::Closed) {
                                window.close();
                        }
                }
        }
}

Ram usage results after 30sec:
test1 - 65 Mb
test2 - 28 Mb
« Last Edit: November 12, 2020, 07:59:29 pm by BTregit »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: RenderTexture does not get destroyed properly when antialiasing is set
« Reply #1 on: November 12, 2020, 11:02:35 pm »
This should already be fixed in master.

Can you give master a try?
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: RenderTexture does not get destroyed properly when antialiasing is set
« Reply #2 on: November 13, 2020, 12:01:37 pm »
Don't forget you can get snapshot builds for the master branch here as well ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

BTregit

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: RenderTexture does not get destroyed properly when antialiasing is set
« Reply #3 on: November 13, 2020, 03:46:45 pm »
I built master from 20 september, runned my test code and results are the same.

Anyway i tested it few more times and found out that behaviour depends on size and antialiasing level:
  -size 8000x1200, antialiasing 8             works
  -size 8000x1200, antialiasing 4             does not work
  -size 14000x1200, antialiasing 4 or 8   works
  -size 1200x5000, antialiasing 4 or 8     doesn not work
  -size 3300x5000, antialiasing 4 or 8     works
  -size 3300x7000, antialiasing 4 or 8     works
  -size 5480x2000, antialiasing 4             doesn not work
  -size 5480x2000, antialiasing 8              works

works -  RAM freed
does not works -  RAM not freed


Maybe its hardware/software specific or somthing in openGL.
« Last Edit: November 13, 2020, 08:49:27 pm by BTregit »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: RenderTexture does not get destroyed properly when antialiasing is set
« Reply #4 on: November 14, 2020, 12:42:47 pm »
Since we pass the anti-aliasing level directly to the driver and this behaviour depends on its value, this sounds more like a driver bug.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

 

anything