Exemple #1
0
void gla::PrivateManager::translateTopToBottom()
{
#ifdef _WIN32
    unsigned int oldFormat = _set_output_format(_TWO_DIGIT_EXPONENT);
#endif

    runLLVMOptimizations1();

#ifdef _WIN32
    _set_output_format(oldFormat);
#endif

    int innerAoS, outerSoA;
    backEnd->getRegisterForm(outerSoA, innerAoS);
    if (outerSoA != 1)
        UnsupportedFunctionality("SoA in middle end: ", outerSoA);
    if (innerAoS != 4 && innerAoS != 1)
        UnsupportedFunctionality("AoS other than size 4 or 1 in middle end: ", innerAoS);
}
gla::LunarGManager::LunarGManager()
{
    switch (Options.backend) {
    case TGSI:
        backEndTranslator = gla::GetTgsiTranslator(this);
        backEnd = gla::GetTgsiBackEnd();
        break;
    case GLSL:
        backEndTranslator = gla::GetGlslTranslator(this, Options.obfuscate);
        backEnd = gla::GetGlslBackEnd();
        break;
    case Dummy:
        backEndTranslator = gla::GetDummyTranslator(this);
        backEnd = gla::GetDummyBackEnd();
        break;
    default:
        UnsupportedFunctionality("Backend not supported");
        break;
    }
}
gla::LunarGManager::~LunarGManager()
{
    clear();

    switch (Options.backend) {
    case TGSI:
        gla::ReleaseTgsiTranslator(backEndTranslator);
        gla::ReleaseTgsiBackEnd(backEnd);
        break;
    case GLSL:
        gla::ReleaseGlslTranslator(backEndTranslator);
        gla::ReleaseGlslBackEnd(backEnd);
        break;
    case Dummy:
        gla::ReleaseDummyTranslator(backEndTranslator);
        gla::ReleaseDummyBackEnd(backEnd);
        break;
    default:
        UnsupportedFunctionality("Backend not supported");
        break;
    }
}