Source/ThirdParty/ANGLE/src/libGLESv2/Program.cpp
ID3DXBuffer *Program::compileToBinary(const char *hlsl, const char *profile, ID3DXConstantTable **constantTable)
{
    if (!hlsl)
    {
        return NULL;
    }

    ID3DXBuffer *binary = NULL;
    ID3DXBuffer *errorMessage = NULL;

    HRESULT result = D3DXCompileShader(hlsl, (UINT)strlen(hlsl), NULL, NULL, "main", profile, 0, &binary, &errorMessage, constantTable);

    if (SUCCEEDED(result))
    {
        return binary;
    }

    if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
    {
        return error(GL_OUT_OF_MEMORY, (ID3DXBuffer*)NULL);
    }

    if (errorMessage)
    {
        const char *message = (const char*)errorMessage->GetBufferPointer();

        appendToInfoLog("%s\n", message);
        TRACE("\n%s", hlsl);
        TRACE("\n%s", message);
    }

    return NULL;
}
// Compiles the HLSL code of the attached shaders into executable binaries
Compiles the HLSL code of the attached shaders into executable binaries
Compiles the HLSL code of the attached shaders into executable binaries
ID3DXBuffer *Program::compileToBinary(const char *hlsl, const char *profile, ID3DXConstantTable **constantTable)
{
    if (!hlsl)
    {
        return NULL;
    }
    ID3DXBuffer *binary = NULL;
    ID3DXBuffer *errorMessage = NULL;
    HRESULT result = D3DXCompileShader(hlsl, (UINT)strlen(hlsl), NULL, NULL, "main", profile, 0, &binary, &errorMessage, constantTable);
    if (SUCCEEDED(result))
    {
        return binary;
    }
    if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
    {
        return error(GL_OUT_OF_MEMORY, (ID3DXBuffer*)NULL);
    }
    if (errorMessage)
    {
        const char *message = (const char*)errorMessage->GetBufferPointer();
        appendToInfoLog("%s\n", message);
        TRACE("\n%s", hlsl);
        TRACE("\n%s", message);
    }
    return NULL;
}
ID3DXBuffer * Program :: compileToBinary ( const char * hlsl , const char * profile , ID3DXConstantTable * * constantTable ) { if ( ! hlsl ) { return NULL ; } ID3DXBuffer * binary = NULL ; ID3DXBuffer * errorMessage = NULL ; HRESULT result = D3DXCompileShader ( hlsl , ( UINT ) strlen ( hlsl ) , NULL , NULL , " " , profile , 0 , & binary , & errorMessage , constantTable ) ; if ( SUCCEEDED ( result ) ) { return binary ; } if ( result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY ) { return error ( GL_OUT_OF_MEMORY , ( ID3DXBuffer * ) NULL ) ; } if ( errorMessage ) { const char * message = ( const char * ) errorMessage -> GetBufferPointer ( ) ; appendToInfoLog ( " \n " , message ) ; TRACE ( " \n " , hlsl ) ; TRACE ( " \n " , message ) ; } return NULL ; }
Compiles the HLSL code of the attached shaders into executable binaries
Compiles the HLSL code of the attached shaders into executable binaries