2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 17:04:55 +00:00

Bug fixes and ASan build submodule

This commit is contained in:
Jack Andersen
2017-12-11 16:06:19 -10:00
parent 8901ac2150
commit ce6a3aa50c
13 changed files with 96 additions and 40 deletions

View File

@@ -94,6 +94,9 @@ target_link_libraries(urde
${PNG_LIB} libjpeg-turbo squish xxhash zeus
kabufuda jbus ${ZLIB_LIBRARIES} ${LZO_LIB}
${BOO_SYS_LIBS})
if(COMMAND add_sanitizers)
add_sanitizers(urde)
endif()
set_target_properties(urde PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/platforms/mac/Info.plist")

View File

@@ -284,6 +284,7 @@ bool ViewManager::proc()
m_mainWindow->waitForRetrace(m_voiceEngine.get());
CBooModel::ClearModelUniformCounters();
CGraphics::TickRenderTimings();
++logvisor::FrameIndex;
return true;
}

View File

@@ -20,6 +20,33 @@ namespace urde
{
static logvisor::Module Log{"URDE"};
static hecl::SystemString CPUFeatureString(const zeus::CPUInfo& cpuInf)
{
hecl::SystemString features;
if (cpuInf.AESNI)
features += _S("AES-NI");
if (cpuInf.SSE1)
{
if (!features.empty())
features += _S(", SSE1");
else
features += _S("SSE1");
}
if (cpuInf.SSE2)
features += _S(", SSE2");
if (cpuInf.SSE3)
features += _S(", SSE3");
if (cpuInf.SSSE3)
features += _S(", SSSE3");
if (cpuInf.SSE4a)
features += _S(", SSE4a");
if (cpuInf.SSE41)
features += _S(", SSE4.1");
if (cpuInf.SSE42)
features += _S(", SSE4.2");
return features;
}
struct Application : boo::IApplicationCallback
{
hecl::Runtime::FileStoreManager m_fileMgr;
@@ -85,39 +112,7 @@ struct Application : boo::IApplicationCallback
const zeus::CPUInfo& cpuInf = zeus::cpuFeatures();
Log.report(logvisor::Info, "CPU Name: %s", cpuInf.cpuBrand);
Log.report(logvisor::Info, "CPU Vendor: %s", cpuInf.cpuVendor);
hecl::SystemString features;
if (cpuInf.AESNI)
features += _S("AES-NI");
if (cpuInf.SSE1)
{
if (!features.empty())
features += _S(", SSE1");
else
features += _S("SSE1");
}
else
{
Log.report(logvisor::Fatal, _S("URDE requires SSE1 minimum"));
return;
}
if (cpuInf.SSE2)
features += _S(", SSE2");
else
{
Log.report(logvisor::Fatal, _S("URDE requires SSE2 minimum"));
return;
}
if (cpuInf.SSE3)
features += _S(", SSE3");
if (cpuInf.SSSE3)
features += _S(", SSSE3");
if (cpuInf.SSE4a)
features += _S(", SSE4a");
if (cpuInf.SSE41)
features += _S(", SSE4.1");
if (cpuInf.SSE42)
features += _S(", SSE4.2");
Log.report(logvisor::Info, _S("CPU Features: %s"), features.c_str());
Log.report(logvisor::Info, _S("CPU Features: %s"), CPUFeatureString(cpuInf).c_str());
}
};
@@ -128,6 +123,22 @@ hecl::SystemString ExeDir;
static void SetupBasics(bool logging)
{
auto result = zeus::validateCPU();
if (!result.first)
{
#if _WIN32 && !WINDOWS_STORE
char* msg;
asprintf(&msg, "ERROR: This build of URDE requires the following CPU features:\n%s\n",
urde::CPUFeatureString(result.second).c_str());
MessageBoxA(nullptr, msg, "CPU error", MB_OK | MB_ICONERROR);
free(msg);
#else
fprintf(stderr, "ERROR: This build of URDE requires the following CPU features:\n%s\n",
urde::CPUFeatureString(result.second).c_str());
#endif
exit(1);
}
logvisor::RegisterStandardExceptions();
if (logging)
logvisor::RegisterConsoleLogger();