Example #1
0
static int renderspuAtiQuirk_ApplyForModule(LPCSTR pszAtiDll)
{
    int rc;
    HMODULE hAtiDll;

    crDebug("renderspuAtiQuirk_ApplyForModule (%s)", pszAtiDll);

    hAtiDll = GetModuleHandleA(pszAtiDll);
    if (!hAtiDll)
    {
        crDebug("GetModuleHandle failed, %d", GetLastError());
        return VERR_NOT_FOUND;
    }

    rc = renderspuIatPatcherPatchFunction(hAtiDll, "user32.dll", "GetForegroundWindow", (void*)renderspuAtiQuirk_GetForegroundWindow);
    if (RT_FAILURE(rc))
    {
        crDebug("renderspuIatPatcherPatchFunction failed, %d", rc);
        return rc;
    }

    crDebug("renderspuAtiQuirk_ApplyForModule SUCCEEDED!");
    crInfo("ATI Fullscreen qwirk SUCCEEDED!");

    return VINF_SUCCESS;
}
Example #2
0
static void renderspuAtiQuirk_ChkApply()
{
    static GLboolean fChecked = GL_FALSE;
    if (fChecked)
        return;

    fChecked = GL_TRUE;
    if (!renderspuAtiQuirk_Needed())
        return;

    crInfo("This is an ATI card, taking care of fullscreen..");

    /*
     * ATI WDDM-based graphics have an issue with rendering fullscreen.
     * See public tickets #9775 & #9267 .
     * Namely ATI drivers check whether ogl window is foreground and fullscreen
     * and if so - do D3DKMTSetDisplayMode for ogl surface,
     * which prevented any other data from being displayed, no matter what.
     *
     * Here we check whether we're using an ATI card and if so, patch the ogl ICD driver's IAT
     * to replace GetForegroundWindow reference with our renderspuAtiQuirk_GetForegroundWindow,
     * which always returns NULL.
     */
    renderspuAtiQuirk_Apply();
}
static void renderSPUSelfDispatch(SPUDispatchTable *self)
{
    crSPUInitDispatchTable( &(render_spu.self) );
    crSPUCopyDispatchTable( &(render_spu.self), self );

    render_spu.server = (CRServer *)(self->server);

    {
        GLfloat version;
        version = crStrToFloat((const char *) render_spu.ws.glGetString(GL_VERSION));

        if (version>=2.f || crStrstr((const char*)render_spu.ws.glGetString(GL_EXTENSIONS), "GL_ARB_vertex_shader"))
        {
            GLint mu=0;
            render_spu.self.GetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &mu);
            crInfo("Render SPU: GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB=%i", mu);
        }
    }
}
Example #4
0
void RENDER_APIENTRY
renderspuMakeCurrent(GLint crWindow, GLint nativeWindow, GLint ctx)
{
    WindowInfo *window;
    ContextInfo *context;

    /*
    crDebug("%s win=%d native=0x%x ctx=%d", __FUNCTION__, crWindow, (int) nativeWindow, ctx);
    */

    window = (WindowInfo *) crHashtableSearch(render_spu.windowTable, crWindow);
    context = (ContextInfo *) crHashtableSearch(render_spu.contextTable, ctx);

    if (window && context)
    {
#ifdef CHROMIUM_THREADSAFE
        crSetTSD(&_RenderTSD, context);
#else
        render_spu.currentContext = context;
#endif
        context->currentWindow = window;
        if (!window)
        {
            crDebug("Render SPU: MakeCurrent invalid window id: %d", crWindow);
            return;
        }
        if (!context)
        {
            crDebug("Render SPU: MakeCurrent invalid context id: %d", ctx);
            return;
        }

        renderspu_SystemMakeCurrent( window, nativeWindow, context );
        if (!context->everCurrent) {
            /* print OpenGL info */
            const char *extString = (const char *) render_spu.ws.glGetString( GL_EXTENSIONS );
            /*
            crDebug( "Render SPU: GL_EXTENSIONS:   %s", render_spu.ws.glGetString( GL_EXTENSIONS ) );
            */
            crInfo( "Render SPU: GL_VENDOR:   %s", render_spu.ws.glGetString( GL_VENDOR ) );
            crInfo( "Render SPU: GL_RENDERER: %s", render_spu.ws.glGetString( GL_RENDERER ) );
            crInfo( "Render SPU: GL_VERSION:  %s", render_spu.ws.glGetString( GL_VERSION ) );
            crInfo( "Render SPU: GL_EXTENSIONS: %s", render_spu.ws.glGetString( GL_EXTENSIONS ) );
            if (crStrstr(extString, "GL_ARB_window_pos"))
                context->haveWindowPosARB = GL_TRUE;
            else
                context->haveWindowPosARB = GL_FALSE;
            context->everCurrent = GL_TRUE;
        }
        if (crWindow == CR_RENDER_DEFAULT_WINDOW_ID && window->mapPending &&
                !render_spu.render_to_app_window && !render_spu.render_to_crut_window) {
            /* Window[CR_RENDER_DEFAULT_CONTEXT_ID] is special, it's the default window and normally hidden.
             * If the mapPending flag is set, then we should now make the window
             * visible.
             */
            /*renderspu_SystemShowWindow( window, GL_TRUE );*/
            window->mapPending = GL_FALSE;
        }
        window->everCurrent = GL_TRUE;
    }
    else if (!crWindow && !ctx)
    {
        renderspu_SystemMakeCurrent( NULL, 0, NULL );
#ifdef CHROMIUM_THREADSAFE
        crSetTSD(&_RenderTSD, NULL);
#else
        render_spu.currentContext = NULL;
#endif
    }
    else
    {
        crError("renderspuMakeCurrent invalid ids: crWindow(%d), ctx(%d)", crWindow, ctx);
    }
}