VirtualBox

Changeset 31017 in vbox


Ignore:
Timestamp:
Jul 22, 2010 4:55:36 PM (15 years ago)
Author:
vboxsync
Message:

2d: bugfix (v2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r31007 r31017  
    470470int VBoxVHWAGlShader::init()
    471471{
    472     int rc;
     472    int rc = VERR_GENERAL_FAILURE;
    473473    GLint *length;
    474474    const char **sources;
     
    481481        AssertRC(rc);
    482482        if(RT_FAILURE(rc))
    483             return rc;
     483            break;
    484484        sources[i] = maComponents[i]->contents();
    485485    }
    486486
     487    if(RT_SUCCESS(rc))
     488    {
    487489#ifdef DEBUG
    488     VBOXQGLLOG(("\ncompiling shaders:\n------------\n"));
    489     for(int i = 0; i < mcComponents; i++)
    490     {
    491         VBOXQGLLOG(("**********\n%s\n***********\n", sources[i]));
    492     }
    493     VBOXQGLLOG(("------------\n"));
    494 #endif
    495     mShader = vboxglCreateShader(mType);
    496 
    497     VBOXQGL_CHECKERR(
    498             vboxglShaderSource(mShader, mcComponents, sources, length);
    499             );
    500 
    501     VBOXQGL_CHECKERR(
    502             vboxglCompileShader(mShader);
    503             );
    504 
    505     GLint compiled;
    506     VBOXQGL_CHECKERR(
    507             vboxglGetShaderiv(mShader, GL_COMPILE_STATUS, &compiled);
    508             );
     490        VBOXQGLLOG(("\ncompiling shaders:\n------------\n"));
     491        for(int i = 0; i < mcComponents; i++)
     492        {
     493            VBOXQGLLOG(("**********\n%s\n***********\n", sources[i]));
     494        }
     495        VBOXQGLLOG(("------------\n"));
     496#endif
     497        mShader = vboxglCreateShader(mType);
     498
     499        VBOXQGL_CHECKERR(
     500                vboxglShaderSource(mShader, mcComponents, sources, length);
     501                );
     502
     503        VBOXQGL_CHECKERR(
     504                vboxglCompileShader(mShader);
     505                );
     506
     507        GLint compiled;
     508        VBOXQGL_CHECKERR(
     509                vboxglGetShaderiv(mShader, GL_COMPILE_STATUS, &compiled);
     510                );
    509511
    510512#ifdef DEBUG
    511     GLchar * pBuf = new GLchar[16300];
    512     vboxglGetShaderInfoLog(mShader, 16300, NULL, pBuf);
    513     VBOXQGLLOG(("\ncompile log:\n-----------\n%s\n---------\n", pBuf));
    514     delete pBuf;
    515 #endif
    516 
    517     Assert(compiled);
    518     if(compiled)
    519     {
    520         return VINF_SUCCESS;
    521     }
    522 
    523 
    524     VBOXQGL_CHECKERR(
    525             vboxglDeleteShader(mShader);
    526             );
    527     mShader = 0;
     513        GLchar * pBuf = new GLchar[16300];
     514        vboxglGetShaderInfoLog(mShader, 16300, NULL, pBuf);
     515        VBOXQGLLOG(("\ncompile log:\n-----------\n%s\n---------\n", pBuf));
     516        delete[] pBuf;
     517#endif
     518
     519        Assert(compiled);
     520        if(compiled)
     521        {
     522            rc = VINF_SUCCESS;
     523        }
     524        else
     525        {
     526            VBOXQGL_CHECKERR(
     527                    vboxglDeleteShader(mShader);
     528                    );
     529            mShader = 0;
     530        }
     531    }
    528532
    529533    delete[] length;
    530534    delete[] sources;
    531     return VERR_GENERAL_FAILURE;
     535    return rc;
    532536}
    533537
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette