diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2018-01-24 12:19:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-24 12:19:53 +0100 |
| commit | c66156148dd6ced799f10313cfe6c60e5189ac89 (patch) | |
| tree | 594a3ade77c1484e9b4b899493ffeac0a6a7b358 /Source/Core/VideoBackends/OGL/OGLTexture.cpp | |
| parent | c3dc8bf1c0fd8151fed6557a90a72040361ae394 (diff) | |
| parent | 38e0b6e2ab53374e7335fee94209bb90cb3e9ed2 (diff) | |
Merge pull request #6317 from stenzek/renderer-bind
AbstractTexture: Move Bind() method to Renderer
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLTexture.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLTexture.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLTexture.cpp b/Source/Core/VideoBackends/OGL/OGLTexture.cpp index 97f7500f71..55b50927d3 100644 --- a/Source/Core/VideoBackends/OGL/OGLTexture.cpp +++ b/Source/Core/VideoBackends/OGL/OGLTexture.cpp @@ -19,9 +19,6 @@ namespace OGL { namespace { -std::array<u32, 8> s_Textures; -u32 s_ActiveTexture; - GLenum GetGLInternalFormatForTextureFormat(AbstractTextureFormat format, bool storage) { switch (format) @@ -120,26 +117,15 @@ OGLTexture::OGLTexture(const TextureConfig& tex_config) : AbstractTexture(tex_co // method is in the base renderer class and can be called by VideoCommon. FramebufferManager::SetFramebuffer(0); } - - SetStage(); } OGLTexture::~OGLTexture() { if (m_texId) - { - for (auto& gtex : s_Textures) - if (gtex == m_texId) - gtex = 0; glDeleteTextures(1, &m_texId); - m_texId = 0; - } if (m_framebuffer) - { glDeleteFramebuffers(1, &m_framebuffer); - m_framebuffer = 0; - } } GLuint OGLTexture::GetRawTexIdentifier() const @@ -152,21 +138,6 @@ GLuint OGLTexture::GetFramebuffer() const return m_framebuffer; } -void OGLTexture::Bind(unsigned int stage) -{ - if (s_Textures[stage] != m_texId) - { - if (s_ActiveTexture != stage) - { - glActiveTexture(GL_TEXTURE0 + stage); - s_ActiveTexture = stage; - } - - glBindTexture(GL_TEXTURE_2D_ARRAY, m_texId); - s_Textures[stage] = m_texId; - } -} - void OGLTexture::CopyRectangleFromTexture(const AbstractTexture* src, const MathUtil::Rectangle<int>& src_rect, u32 src_layer, u32 src_level, const MathUtil::Rectangle<int>& dst_rect, @@ -300,19 +271,6 @@ void OGLTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8 if (row_length != width) glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - - SetStage(); -} - -void OGLTexture::DisableStage(unsigned int stage) -{ -} - -void OGLTexture::SetStage() -{ - // -1 is the initial value as we don't know which texture should be bound - if (s_ActiveTexture != (u32)-1) - glActiveTexture(GL_TEXTURE0 + s_ActiveTexture); } OGLStagingTexture::OGLStagingTexture(StagingTextureType type, const TextureConfig& config, @@ -444,7 +402,6 @@ void OGLStagingTexture::CopyFromTexture(const AbstractTexture* src, glBindTexture(GL_TEXTURE_2D_ARRAY, gltex->GetRawTexIdentifier()); glGetTexImage(GL_TEXTURE_2D_ARRAY, src_level, GetGLFormatForTextureFormat(m_config.format), GetGLTypeForTextureFormat(m_config.format), nullptr); - OGLTexture::SetStage(); } } @@ -507,7 +464,6 @@ void OGLStagingTexture::CopyToTexture(const MathUtil::Rectangle<int>& src_rect, dst_rect.GetWidth(), dst_rect.GetHeight(), 1, GetGLFormatForTextureFormat(m_config.format), GetGLTypeForTextureFormat(m_config.format), reinterpret_cast<void*>(src_offset)); - OGLTexture::SetStage(); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); |
