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 { pub struct Instance {
_static_functions: StaticFunctions, _static_functions: StaticFunctions,
_entry_functions: EntryFunctions, _entry_functions: Option<EntryFunctions>,
pub(crate) instance_functions: InstanceFunctions, pub(crate) instance_functions: InstanceFunctions,
instance_wsi_functions: InstanceWSIFunctions, instance_wsi_functions: InstanceWSIFunctions,
physical_device_properties2_functions: PhysicalDeviceProperties2Functions, 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 { impl Instance {
pub fn preinitialized( pub fn preinitialized(
instance: VkInstance, instance: VkInstance,
@ -122,44 +106,21 @@ impl Instance {
extensions: &[VkString], extensions: &[VkString],
api_version: u32, api_version: u32,
) -> Result<Arc<Instance>> { ) -> Result<Arc<Instance>> {
log("Instance::preinitialized: start");
let static_functions = StaticFunctions { let static_functions = StaticFunctions {
_lib: None, _lib: None,
vkGetInstanceProcAddr: proc_addr, 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); let instance_functions = InstanceFunctions::new(&static_functions, instance);
log("Instance::preinitialized: InstanceFunctions");
let instance_wsi_functions = InstanceWSIFunctions::new(&static_functions, instance); let instance_wsi_functions = InstanceWSIFunctions::new(&static_functions, instance);
log("Instance::preinitialized: InstanceWSIFunctions");
let physical_device_properties2_functions = let physical_device_properties2_functions =
PhysicalDeviceProperties2Functions::new(&static_functions, instance); PhysicalDeviceProperties2Functions::new(&static_functions, instance);
log("Instance::preinitialized: PhysicalDeviceProperties2Functions");
let debug_report_callback_functions = let debug_report_callback_functions =
DebugReportCallbackFunctions::new(&static_functions, instance); DebugReportCallbackFunctions::new(&static_functions, instance);
log("Instance::preinitialized: DebugReportCallbackFunctions");
let instance_extensions = InstanceExtensions::from_list(extensions); let instance_extensions = InstanceExtensions::from_list(extensions);
log("Instance::preinitialized: InstanceExtensions");
let instance = Arc::new(Instance { let instance = Arc::new(Instance {
_static_functions: static_functions, _static_functions: static_functions,
_entry_functions: entry_functions, _entry_functions: None,
instance_functions, instance_functions,
instance_wsi_functions, instance_wsi_functions,
physical_device_properties2_functions, physical_device_properties2_functions,
@ -175,8 +136,6 @@ impl Instance {
api_version, api_version,
}); });
log("Instance::preinitialized: Arc<Instance> created!");
Ok(instance) Ok(instance)
} }
@ -282,7 +241,7 @@ impl Instance {
let mut instance = Instance { let mut instance = Instance {
_static_functions: static_functions, _static_functions: static_functions,
_entry_functions: entry_functions, _entry_functions: Some(entry_functions),
instance_functions, instance_functions,
instance_wsi_functions, instance_wsi_functions,
physical_device_properties2_functions, physical_device_properties2_functions,