Spirv binaries are now compiled into the standard asset bundle
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user