티스토리 뷰

카테고리 없음

Thread OpenGL (2)

newpolaris 2020. 1. 23. 16:18

별도의 Thread에서 계속 렌더링 및 SwapBuffer 호출을 진행하니,

검은 화면이 보인다. 윈도우 Event는 아무것도 안들어오는 깨끗한 상태이다

while (!m_exit)
{
    bgfx::renderFrame();

    s_xinput.update(m_eventQueue);
    WaitForInputIdle(GetCurrentProcess(), 16); // 이부분 제거해야 잘 보임

    while (0 != PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE) )
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
}
     example-01-cubesDebug.exe!bx::Semaphore::post(unsigned int _count) Line 257    C++
>    example-01-cubesDebug.exe!bgfx::Context::renderFrame(int _msecs) Line 2306    C++
     example-01-cubesDebug.exe!bgfx::renderFrame(int _msecs) Line 1397    C++
     example-01-cubesDebug.exe!entry::Context::run(int _argc, const char * const * _argv) Line 519    C++
     example-01-cubesDebug.exe!main(int _argc, const char * const * _argv) Line 1150    C++

apiWait와 renderSemPost 등으로 렌더링 시작과 끝이 guard 된 상태

        // Unfortunately, some platforms might force us to have sync points between the GL thread
        // and user thread. To prevent deadlock on these platforms, we chop up the waiting time into
        // polling and pumping the platform's event queue.
    /**
     * Processes the platform's event queue when called from its primary event-handling thread.
     *
     * Internally, Filament might need to call this when waiting on a fence. It is only implemented
     * on platforms that need it, such as macOS + OpenGL. Returns false if this is not the main
     * thread, or if the platform does not need to perform any special processing.
     */
    virtual bool pumpEvents() noexcept { return false; }
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크