문제

My laptop has both Intel integrated graphics and NVidia dedicated graphics, and I can choose which one a particular program gets run on through the right-click menu. I'm learning OpenGL and rendered a basic cube, and compared the framerates with the two. I was surprised to find that while on the dedicated graphics it got around 600 FPS, it got about 1300 FPS on the integrated graphics which doesn't really make sense...anybody know why this is? Here's the relevant rendering code:

GLuint VBO;
glGenBuffers(1, &VBO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(VertexData), VertexData, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);

GLuint VAO;
glGenVertexArrays(1, &VAO);
glBindVertexArray(VAO);

GLuint ElementArray;
glGenBuffers(1, &ElementArray);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ElementArray);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(ElementData), ElementData, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

size_t ColorData = 4 * 8 * sizeof(float);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0);
glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 0, (void*)ColorData);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ElementArray);
glBindBuffer(GL_ARRAY_BUFFER, 0);

glBindVertexArray(0);

glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glFrontFace(GL_CW);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL);
glDepthRange(0.0f, 1.0f);

glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClearDepth(1.0f);

glBindVertexArray(VAO);

while(!Window.ShouldClose())
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glDrawElements(GL_TRIANGLE_FAN, 8, GL_UNSIGNED_SHORT, 0);
    glDrawElements(GL_TRIANGLE_FAN, 8, GL_UNSIGNED_SHORT, (void*) (8*sizeof(GLshort)));

    Window.PollEvents();
    Window.SwapBuffers();
}

Maybe it is a driver inefficiency?

If it helps at all, my integrated graphics chipset is the Intel HD Graphics 4000 and my dedicated graphics is a Geforce GT 630 M, and my CPU is Core i5 3230M, with 6 GB RAM

도움이 되었습니까?

해결책

I'm assuming the 2nd one is the integrated graphic, not dedicated, as woolstar commented.

From memory, Intel integrated GPU can speak directly to cpu and/or memory, hence, for video encoding stuff it used to get much better performance than a dedicated GPU.

Having said that, they internal one is usually rubbish compared to new generation GPU's (spell "cheap").

Also, do notice that it absolutely makes no difference, since your won't notice the difference between 600 and 1300 fps anyways (just think about your screen refresh rate :) ).

Probably once you load more, you might see different results, but this should give you the basic idea of the "why".


Even though it's been marked as answered, here are some extra links for reading on the above:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top