diff --git a/FrameBuffer.cpp b/FrameBuffer.cpp index ec83d95a..d8ac2c28 100644 --- a/FrameBuffer.cpp +++ b/FrameBuffer.cpp @@ -1060,7 +1060,7 @@ void RDRAMtoFrameBuffer::CopyFromRDRAM( u32 _address, bool _bUseAlpha) m_pTexture->height = height; const u32 dataSize = width*height*4; #ifndef GLES2 - PBOBinder binder(m_PBO); + PBOBinder binder(GL_PIXEL_UNPACK_BUFFER, m_PBO); glBufferData(GL_PIXEL_UNPACK_BUFFER, dataSize, NULL, GL_DYNAMIC_DRAW); GLubyte* ptr = (GLubyte*)glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); #else diff --git a/FrameBuffer.h b/FrameBuffer.h index b6e35968..d4ac3627 100644 --- a/FrameBuffer.h +++ b/FrameBuffer.h @@ -80,13 +80,14 @@ private: struct PBOBinder { #ifndef GLES2 - PBOBinder(GLuint _PBO) + PBOBinder(GLenum _target, GLuint _PBO) : m_target(_target) { - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, _PBO); + glBindBuffer(m_target, _PBO); } ~PBOBinder() { - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glBindBuffer(m_target, 0); } + GLenum m_target; #else PBOBinder(GLubyte* _ptr) : ptr(_ptr) {} ~PBOBinder() { free(ptr); } diff --git a/GLSLCombiner.cpp b/GLSLCombiner.cpp index 13d81673..c8fd4faf 100644 --- a/GLSLCombiner.cpp +++ b/GLSLCombiner.cpp @@ -133,7 +133,7 @@ void NoiseTexture::update() if (dataSize == 0) return; #ifndef GLES2 - PBOBinder binder(m_PBO); + PBOBinder binder(GL_PIXEL_UNPACK_BUFFER, m_PBO); glBufferData(GL_PIXEL_UNPACK_BUFFER, dataSize, NULL, GL_DYNAMIC_DRAW); GLubyte* ptr = (GLubyte*)glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); #else