]> git.sesse.net Git - movit/blobdiff - resource_pool.cpp
Save a mul in YCbCrInput by folding the scaling into the matrix.
[movit] / resource_pool.cpp
index db449dd7084f412ef63551a04a823245f7a9eff1..eba79237678611bf474c065f81111e49531cfb94 100644 (file)
@@ -294,8 +294,8 @@ void ResourcePool::release_2d_texture(GLuint texture_num)
        texture_freelist_bytes += estimate_texture_size(texture_formats[texture_num]);
 
        while (texture_freelist_bytes > texture_freelist_max_bytes) {
-               GLuint free_texture_num = texture_freelist.front();
-               texture_freelist.pop_front();
+               GLuint free_texture_num = texture_freelist.back();
+               texture_freelist.pop_back();
                assert(texture_formats.count(free_texture_num) != 0);
                texture_freelist_bytes -= estimate_texture_size(texture_formats[free_texture_num]);
                texture_formats.erase(free_texture_num);
@@ -401,6 +401,7 @@ void ResourcePool::cleanup_unlinked_fbos(void *context)
                pair<void *, GLuint> key(context, fbo_num);
                assert(fbo_formats.count(key) != 0);
                if (fbo_formats[key].texture_num == 0) {
+                       fbo_formats.erase(key);
                        glDeleteFramebuffers(1, &fbo_num);
                        check_error();
                        fbo_freelist[context].erase(freelist_it++);