ValhallaTeam / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Infinite recursion in Query9::getResult #416

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Chrome occlusion query GL unit tests fail with dx11proto branch. It's this test 
OcclusionQueryTest.Occlusion, here:

https://code.google.com/searchframe#OAMlx_jo-ck/src/gpu/command_buffer/tests/occ
lusion_query_unittests.cc&exact_package=chromium&q=OcclusionQueryTest&type=cs&l=
70

Query9::getResult() goes into an infinite recurstion:

    libGLESv2.dll!rx::Query11::getResult()  Line 64 + 0x2 bytes C++
    libGLESv2.dll!rx::Query11::getResult()  Line 78 + 0x9 bytes C++
    libGLESv2.dll!rx::Query11::getResult()  Line 78 + 0x9 bytes C++
    libGLESv2.dll!rx::Query11::getResult()  Line 78 + 0x9 bytes C++
    libGLESv2.dll!rx::Query11::getResult()  Line 78 + 0x9 bytes C++
    libGLESv2.dll!rx::Query11::getResult()  Line 78 + 0x9 bytes C++
    libGLESv2.dll!rx::Query11::getResult()  Line 78 + 0x9 bytes C++
    libGLESv2.dll!rx::Query11::getResult()  Line 78 + 0x9 bytes C++
    libGLESv2.dll!rx::Query11::getResult()  Line 78 + 0x9 bytes C++
...

Thr Direct3D11 renderer has the same issue.

GLuint Query9::getResult()
{
    if (mQuery != NULL)
    {
        while (!testQuery())
        {
            Sleep(0);
            // explicitly check for device loss
            // some drivers seem to return S_FALSE even if the device is lost
            // instead of D3DERR_DEVICELOST like they should
            if (mRenderer->testDeviceLost(true))
            {
                return gl::error(GL_OUT_OF_MEMORY, 0);
            }
        }
    }

    return getResult(); <-- recursion
}

Original issue reported on code.google.com by apatr...@chromium.org on 4 Mar 2013 at 10:34

GoogleCodeExporter commented 9 years ago
This is the result of some base class/child accessor confusion. Will provide a 
fix shortly.

Original comment by shannon....@gtempaccount.com on 4 Mar 2013 at 11:01

GoogleCodeExporter commented 9 years ago
Fix committed in r1988

Original comment by shannon....@gtempaccount.com on 5 Mar 2013 at 8:38