tool/vfx/vfxSection.cpp
bool SectionShader::CompileShader(
    const std::string&  docFilename,      // [in] File name of parent document
    const Section*      pShaderInfo,      // [in] Shader info sections
    std::string*        pErrorMsg)        // [out] Error message
{
    bool result = false;
    switch (m_shaderType)
    {
    case Glsl:
    case Hlsl:
        {
            result = CompileGlsl(pShaderInfo, pErrorMsg);
            break;
        }
    case GlslFile:
    case HlslFile:
        {
            result = ReadFile(docFilename, fileName, false, &m_spvBin, &shaderSource, pErrorMsg);
            if (result)
            {
                CompileGlsl(pShaderInfo, pErrorMsg);
            }
            break;
        }
    case SpirvAsm:
        {
            result = AssembleSpirv(pErrorMsg);
            break;
        }
    case SpirvAsmFile:
        {
            result = ReadFile(docFilename, fileName, false, &m_spvBin, &shaderSource, pErrorMsg);
            if (result)
            {
                AssembleSpirv(pErrorMsg);
            }
            break;
        }
    case SpirvFile:
        {
            result = ReadFile(docFilename, fileName, true, &m_spvBin, &shaderSource, pErrorMsg);
            break;
        }
    default:
        {
            VFX_NEVER_CALLED();
            break;
        }
    }
    return result;
}
// =====================================================================================================================
// Loads external shader code, and translate shader code to SPIRV binary
Loads external shader code, and translate shader code to SPIRV binary
Loads external shader code and translate shader code to SPIRV binary
bool SectionShader::CompileShader(
    const std::string&  docFilename,      
    const Section*      pShaderInfo,      
    std::string*        pErrorMsg)        
{
    bool result = false;
    switch (m_shaderType)
    {
    case Glsl:
    case Hlsl:
        {
            result = CompileGlsl(pShaderInfo, pErrorMsg);
            break;
        }
    case GlslFile:
    case HlslFile:
        {
            result = ReadFile(docFilename, fileName, false, &m_spvBin, &shaderSource, pErrorMsg);
            if (result)
            {
                CompileGlsl(pShaderInfo, pErrorMsg);
            }
            break;
        }
    case SpirvAsm:
        {
            result = AssembleSpirv(pErrorMsg);
            break;
        }
    case SpirvAsmFile:
        {
            result = ReadFile(docFilename, fileName, false, &m_spvBin, &shaderSource, pErrorMsg);
            if (result)
            {
                AssembleSpirv(pErrorMsg);
            }
            break;
        }
    case SpirvFile:
        {
            result = ReadFile(docFilename, fileName, true, &m_spvBin, &shaderSource, pErrorMsg);
            break;
        }
    default:
        {
            VFX_NEVER_CALLED();
            break;
        }
    }
    return result;
}
bool SectionShader :: CompileShader ( const std :: string & docFilename , const Section * pShaderInfo , std :: string * pErrorMsg ) { bool result = false ; switch ( m_shaderType ) { case Glsl : case Hlsl : { result = CompileGlsl ( pShaderInfo , pErrorMsg ) ; break ; } case GlslFile : case HlslFile : { result = ReadFile ( docFilename , fileName , false , & m_spvBin , & shaderSource , pErrorMsg ) ; if ( result ) { CompileGlsl ( pShaderInfo , pErrorMsg ) ; } break ; } case SpirvAsm : { result = AssembleSpirv ( pErrorMsg ) ; break ; } case SpirvAsmFile : { result = ReadFile ( docFilename , fileName , false , & m_spvBin , & shaderSource , pErrorMsg ) ; if ( result ) { AssembleSpirv ( pErrorMsg ) ; } break ; } case SpirvFile : { result = ReadFile ( docFilename , fileName , true , & m_spvBin , & shaderSource , pErrorMsg ) ; break ; } default : { VFX_NEVER_CALLED ( ) ; break ; } } return result ; }
Loads external shader code, and translate shader code to SPIRV binary
Loads external shader code and translate shader code to SPIRV binary
// [in] File name of parent document // [in] Shader info sections // [out] Error message