1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Add target parameter to PBOBinder struct.

This commit is contained in:
Sergey Lipskiy 2015-03-24 20:04:39 +06:00
parent 905385f251
commit 778d1e38d5
3 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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); }

View File

@ -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