diff options
author | Arisotura <thetotalworm@gmail.com> | 2019-04-01 04:58:21 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2019-04-01 04:58:21 +0200 |
commit | 00341bbae5a0344fece4fdffb586bfdfb716959b (patch) | |
tree | 537e0236753122cb12481cfe2d702364613ab7b8 | |
parent | 4bf75a8d8ee1a5adae7dd1deb571ef943d874ce7 (diff) |
actually, seems faster to read it all at once??
-rw-r--r-- | src/GPU3D_OpenGL43.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/GPU3D_OpenGL43.cpp b/src/GPU3D_OpenGL43.cpp index ea8bbd7..2e15cfa 100644 --- a/src/GPU3D_OpenGL43.cpp +++ b/src/GPU3D_OpenGL43.cpp @@ -114,7 +114,8 @@ bool Init() glGenBuffers(1, &PixelbufferID); glBindBuffer(GL_PIXEL_PACK_BUFFER, PixelbufferID); - glBufferData(GL_PIXEL_PACK_BUFFER, 256*48*4, NULL, GL_DYNAMIC_READ); + //glBufferData(GL_PIXEL_PACK_BUFFER, 256*48*4, NULL, GL_DYNAMIC_READ); + glBufferData(GL_PIXEL_PACK_BUFFER, 256*192*4, NULL, GL_DYNAMIC_READ); return true; } @@ -142,7 +143,8 @@ void RenderFrame() glReadBuffer(GL_COLOR_ATTACHMENT0); //glReadPixels(0, 0, 256, 48, GL_RGBA, GL_UNSIGNED_BYTE, Framebuffer); glBindBuffer(GL_PIXEL_PACK_BUFFER, PixelbufferID); - glReadPixels(0, 0, 256, 48, GL_BGRA, GL_UNSIGNED_BYTE, NULL); + //glReadPixels(0, 0, 256, 48, GL_BGRA, GL_UNSIGNED_BYTE, NULL); + glReadPixels(0, 0, 256, 192, GL_BGRA, GL_UNSIGNED_BYTE, NULL); } void RequestLine(int line) @@ -150,12 +152,13 @@ void RequestLine(int line) if (line == 0) { u8* data = (u8*)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); - if (data) memcpy(&Framebuffer[4*256*0], data, 4*256*48); + //if (data) memcpy(&Framebuffer[4*256*0], data, 4*256*48); + if (data) memcpy(&Framebuffer[4*256*0], data, 4*256*192); glUnmapBuffer(GL_PIXEL_PACK_BUFFER); - glReadPixels(0, 48, 256, 48, GL_BGRA, GL_UNSIGNED_BYTE, NULL); + //glReadPixels(0, 48, 256, 48, GL_BGRA, GL_UNSIGNED_BYTE, NULL); } - else if (line == 48) + /*else if (line == 48) { u8* data = (u8*)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); if (data) memcpy(&Framebuffer[4*256*48], data, 4*256*48); @@ -176,7 +179,7 @@ void RequestLine(int line) u8* data = (u8*)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); if (data) memcpy(&Framebuffer[4*256*144], data, 4*256*48); glUnmapBuffer(GL_PIXEL_PACK_BUFFER); - } + }*/ } u32* GetLine(int line) |