BOOL CShaderConverter::ExportProgram(const SShaderConfig& config) { VRETURN(m_CompiledPSList.size() == m_CompiledVSList.size()); for (size_t i = 0; i < m_CompiledVSList.size(); i++) { const izanagi::tool::CString strVS = m_CompiledVSList[i]; const izanagi::tool::CString strPS = m_CompiledPSList[i]; VRETURN(_ExportFile(config, strVS, &m_Out)); VRETURN(_ExportFile(config, strPS, &m_Out)); } return TRUE; }
BOOL CPostEffectConverter::ExportPSProgram() { std::vector<izanagi::tool::CString>::const_iterator it = m_CompiledPSList.begin(); for (; it != m_CompiledPSList.end(); it++) { const izanagi::tool::CString strPS = *it; VRETURN(_ExportFile(strPS, &m_Out)); } return TRUE; }
BOOL CPostEffectConverter::ExportVSProgram() { std::vector<SVSInfo>::const_iterator it = m_CompiledVSList.begin(); std::vector<izanagi::E_POSTEFFECT_VTX_SHADER> tvExportedVSType; tvExportedVSType.reserve(m_CompiledVSList.size()); std::vector<izanagi::E_POSTEFFECT_VTX_SHADER>::const_iterator itType; for (; it != m_CompiledVSList.end(); it++) { const SVSInfo& sVSInfo = *it; // Check whether vertex program is exported. itType = std::find( tvExportedVSType.begin(), tvExportedVSType.end(), sVSInfo.type); if (itType == tvExportedVSType.end()) { // If not exported. izanagi::S_PES_VS_HEADER sVSHeader; sVSHeader.type = sVSInfo.type; sVSHeader.sizeProgram = _GetFileSize(sVSInfo.file); IZ_OUTPUT_WRITE_VRETURN(&m_Out, &sVSHeader, 0, sizeof(sVSHeader)); VRETURN(_ExportFile(sVSInfo.file, &m_Out)); tvExportedVSType.push_back(sVSInfo.type); m_PesHeader.numVtxProgram++; m_PesHeader.maxProgamSize = IZ_MAX(m_PesHeader.maxProgamSize, sVSHeader.sizeProgram); } } return TRUE; }