Remove logging

This commit is contained in:
hodasemi 2023-02-20 09:08:31 +01:00
parent 7901c3d9f0
commit b680b0e61c

View file

@ -34,7 +34,7 @@ pub struct VulkanDebugInfo {
pub struct Instance {
_static_functions: StaticFunctions,
_entry_functions: EntryFunctions,
_entry_functions: Option<EntryFunctions>,
pub(crate) instance_functions: InstanceFunctions,
instance_wsi_functions: InstanceWSIFunctions,
physical_device_properties2_functions: PhysicalDeviceProperties2Functions,
@ -99,22 +99,6 @@ impl Layer {
}
}
fn log(msg: impl ToString) {
use std::io::Write;
let home = std::env::var("HOME").unwrap();
let log_file = format!("{}/rf2_vk_hud.log", home);
if let Ok(mut file) = std::fs::OpenOptions::new()
.append(true)
.create(true)
.open(&log_file)
{
if let Err(_) = file.write_all(format!("{}\n", msg.to_string()).as_bytes()) {}
}
}
impl Instance {
pub fn preinitialized(
instance: VkInstance,
@ -122,44 +106,21 @@ impl Instance {
extensions: &[VkString],
api_version: u32,
) -> Result<Arc<Instance>> {
log("Instance::preinitialized: start");
let static_functions = StaticFunctions {
_lib: None,
vkGetInstanceProcAddr: proc_addr,
};
log("Instance::preinitialized: StaticFunctions");
let entry_functions = EntryFunctions::new(&static_functions);
log("Instance::preinitialized: EntryFunctions");
let instance_functions = InstanceFunctions::new(&static_functions, instance);
log("Instance::preinitialized: InstanceFunctions");
let instance_wsi_functions = InstanceWSIFunctions::new(&static_functions, instance);
log("Instance::preinitialized: InstanceWSIFunctions");
let physical_device_properties2_functions =
PhysicalDeviceProperties2Functions::new(&static_functions, instance);
log("Instance::preinitialized: PhysicalDeviceProperties2Functions");
let debug_report_callback_functions =
DebugReportCallbackFunctions::new(&static_functions, instance);
log("Instance::preinitialized: DebugReportCallbackFunctions");
let instance_extensions = InstanceExtensions::from_list(extensions);
log("Instance::preinitialized: InstanceExtensions");
let instance = Arc::new(Instance {
_static_functions: static_functions,
_entry_functions: entry_functions,
_entry_functions: None,
instance_functions,
instance_wsi_functions,
physical_device_properties2_functions,
@ -175,8 +136,6 @@ impl Instance {
api_version,
});
log("Instance::preinitialized: Arc<Instance> created!");
Ok(instance)
}
@ -282,7 +241,7 @@ impl Instance {
let mut instance = Instance {
_static_functions: static_functions,
_entry_functions: entry_functions,
_entry_functions: Some(entry_functions),
instance_functions,
instance_wsi_functions,
physical_device_properties2_functions,