I've read that above GL4.3, to copy one tex to the other, glCopyImageSubData will be the fastest solution,
but after some forloop nested compare, it just not is the case here , glCopyImageSubData is a bunch of FPS slower(~220fps vs ~260fps),
what am I missing can you tell ? is it my hardware ? I'm on GTX 1060 Max-Q ... both testbuf1 & testbuf2 own a TEXTURE_2D buffer and a framebuffer, same size and all
for (int i = 0; i < 1000; ++i) {
if (compare) {
glBindFramebuffer(GL_FRAMEBUFFER, testbuf2.fb_id);
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D,testbuf1.tex_id);
glUseProgram(shader.program);
vbo.draw();
}else{
glCopyImageSubData(
testbuf1.tex_id, GL_TEXTURE_2D, 0, 0, 0, 0,
testbuf2.tex_id, GL_TEXTURE_2D, 0, 0, 0, 0,
testbuf1.width,testbuf1.height, 1);
}
}