gsdx ogl: implement CommitPages

This commit is contained in:
Gregory Hainaut 2019-02-07 12:17:15 +01:00 committed by lightningterror
parent e8b2d036ee
commit 16d5f477ff
2 changed files with 20 additions and 0 deletions

View File

@ -515,6 +515,24 @@ void GSTextureOGL::GenerateMipmap()
}
}
void GSTextureOGL::CommitPages(const GSVector2i& region, bool commit)
{
GLState::available_vram += m_mem_usage;
if (commit) {
GL_INS("CommitPages %dx%d of %u", region.x, region.y, m_texture_id);
m_committed_size = region;
} else {
GL_INS("CommitPages release of %u", m_texture_id);
m_committed_size = GSVector2i(0, 0);
}
m_mem_usage = (m_committed_size.x * m_committed_size.y) << m_int_shift;
GLState::available_vram -= m_mem_usage;
glTexturePageCommitmentEXT(m_texture_id, GL_TEX_LEVEL_0, 0, 0, 0, m_committed_size.x, m_committed_size.y, 1, commit);
}
bool GSTextureOGL::Save(const std::string& fn)
{
// Collect the texture data

View File

@ -84,5 +84,7 @@ class GSTextureOGL final : public GSTexture
void Clear(const void* data);
void Clear(const void* data, const GSVector4i& area);
void CommitPages(const GSVector2i& region, bool commit) final;
uint32 GetMemUsage();
};