Skip to content
Permalink
Browse files

gsdx ogl: implement CommitPages

  • Loading branch information...
gregory38 authored and lightningterror committed Feb 7, 2019
1 parent e8b2d03 commit 16d5f477ff58d3f3fe2c659684735620c2725302
Showing with 20 additions and 0 deletions.
  1. +18 −0 plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp
  2. +2 −0 plugins/GSdx/Renderers/OpenGL/GSTextureOGL.h
@@ -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
@@ -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();
};

0 comments on commit 16d5f47

Please sign in to comment.
You can’t perform that action at this time.