我正在使用 OpenGL ES 分析器。它表明调用 glResolveMultisampleFramebufferAPPLE() 需要大约 90% 的运行时间。这是典型的,还是我的代码效率低下?这是我的绘图代码:
glBindFramebuffer(GL_FRAMEBUFFER, sampleFramebuffer);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw Stuff . . .
glBindFramebuffer(GL_DRAW_FRAMEBUFFER_APPLE, defaultFramebuffer);
glBindFramebuffer(GL_READ_FRAMEBUFFER_APPLE, sampleFramebuffer);
glResolveMultisampleFramebufferAPPLE();
const GLenum discard1[] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT};
glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 2, discard1);
const GLenum discard2[] = {GL_DEPTH_ATTACHMENT};
glDiscardFramebufferEXT(GL_DRAW_FRAMEBUFFER_APPLE, 1, discard2);
glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
[[EAGLContext currentContext] presentRenderbuffer:GL_RENDERBUFFER];
场景很复杂,每帧渲染超过一百万个三角形。我认为我的慢帧速率(10 fps)是由于绘制调用 - 而不是多重采样。有什么想法吗?