cancel
Showing results for 
Search instead for 
Did you mean: 

Newcomers Start Here

manueru
Adept I

glMapBufferRange leaking memory on Adrenaline drivers older than 22.5.1

Hi,

 

I think there is a memory leak in glMapBufferRange since Adrenaline OpenGL Drivers version 22.5.2. This is the way I use it (this code doesn't leak memory on nVidia GPUs):

 

 

 

 

        void *mapped_data_offseted;
        GLboolean res;

        mapped_data_offseted = glMapBufferRange(
                        binding_type, 
                        (GLintptr)*current_offset_in_bytes, 
                        (GLsizeiptr)array_buffer_size_in_bytes, 
                        GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_WRITE_BIT);
        assert_no_null(mapped_data_offseted);

        memcpy(mapped_data_offseted, array_buffer_contents, array_buffer_size_in_bytes);

        res = glUnmapBuffer(binding_type);
        assert(res == GL_TRUE);

 

 

 

 

It seems the driver is leaking memory everytime I call this function, it didn't happend in version 22.5.1 or sooner. If I change this code to:

 

 

 

 

        glBufferSubData(
                        binding_type, 
                        (GLintptr)*current_offset_in_bytes, 
                        (GLsizeiptr)array_buffer_size_in_bytes, 
                        array_buffer_contents);
        bsglcommon_check_ogl_error();

 

 

 

 

Everything works perfectly. 


0 Likes
0 Replies