Added KrCompileAllShaders and stub implementation

This commit is contained in:
2020-08-06 18:15:58 -07:00
parent b405c3014f
commit 78172b5abc
9 changed files with 77 additions and 10 deletions

View File

@@ -106,6 +106,7 @@ KRContext::KRContext(const KrInitializeInfo* initializeInfo)
#endif
createDeviceContexts();
glslang::InitializeProcess();
}
KRContext::~KRContext() {
@@ -170,6 +171,7 @@ KRContext::~KRContext() {
delete m_resourceMap;
m_resourceMap = NULL;
}
glslang::FinalizeProcess();
}
void KRContext::SetLogCallback(log_callback *log_callback, void *user_data)
@@ -493,6 +495,15 @@ KrResult KRContext::moveToBundle(const KrMoveToBundleInfo* moveToBundleInfo)
return resource->moveToBundle(bundle);
}
KrResult KRContext::compileAllShaders(const KrCompileAllShadersInfo* pCompileAllShadersInfo) {
bool success = m_pShaderManager->compileAll();
if (success) {
// TODO - Save log to a resource
return KR_SUCCESS;
}
return KR_ERROR_SHADER_COMPILE_FAILED;
}
KrResult KRContext::saveResource(const KrSaveResourceInfo* saveResourceInfo)
{
if (saveResourceInfo->resourceHandle < 0 || saveResourceInfo->resourceHandle >= m_resourceMapSize) {