Spirv binaries are now compiled into the standard asset bundle

This commit is contained in:
2020-12-30 17:03:18 -08:00
parent 893092e0ad
commit 75d3f019ae
6 changed files with 67 additions and 20 deletions

View File

@@ -151,29 +151,29 @@ int main( int argc, char *argv[] )
printf("Compiling Shaders... ");
KrCompileAllShadersInfo compile_all_shaders_info = {};
compile_all_shaders_info.sType = KR_STRUCTURE_TYPE_COMPILE_ALL_SHADERS;
compile_all_shaders_info.bundleHandle = ResourceMapping::output_bundle;
compile_all_shaders_info.logHandle = ResourceMapping::shader_compile_log;
res = KrCompileAllShaders(&compile_all_shaders_info);
if (res != KR_SUCCESS) {
printf("[FAIL] (Error %i)\n", res);
KrGetResourceDataInfo get_resource_data_info = {};
get_resource_data_info.sType = KR_STRUCTURE_TYPE_GET_RESOURCE_DATA;
get_resource_data_info.resourceHandle = ResourceMapping::shader_compile_log;
res = KrGetResourceData(&get_resource_data_info, [](const KrGetResourceDataResult& result) {
// TODO - This will later be asynchronous... Will need to block rest of execution until returned
if (result.result != KR_SUCCESS) {
printf("Failed to get shader compile log. (Error %i)\n", result.result);
} else {
// result.data will be a null terminated string
if (result.data != nullptr) {
printf("Shader compile log:\n%s\n", static_cast<char *>(result.data));
}
}
});
failed = true;
}
else {
} else {
printf("[GOOD]\n");
}
KrGetResourceDataInfo get_resource_data_info = {};
get_resource_data_info.sType = KR_STRUCTURE_TYPE_GET_RESOURCE_DATA;
get_resource_data_info.resourceHandle = ResourceMapping::shader_compile_log;
res = KrGetResourceData(&get_resource_data_info, [](const KrGetResourceDataResult& result) {
// TODO - This will later be asynchronous... Will need to block rest of execution until returned
if (result.result != KR_SUCCESS) {
printf("Failed to get shader compile log. (Error %i)\n", result.result);
} else {
// result.data will be a null terminated string
if (result.data != nullptr && static_cast<char*>(result.data)[0] != '\0') {
printf("Shader compile log:\n%s\n", static_cast<char *>(result.data));
}
}
});
}
if (output_bundle && !failed) {