Remove hardcoded logging
This commit is contained in:
parent
8e5e6a8c3c
commit
42900dab46
2 changed files with 0 additions and 48 deletions
|
@ -14,30 +14,12 @@ macro_rules! load_function_ptrs {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl $struct_name {
|
impl $struct_name {
|
||||||
fn log(msg: impl ToString) {
|
|
||||||
use std::io::Write;
|
|
||||||
|
|
||||||
if let Ok(home) = std::env::var("HOME") {
|
|
||||||
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()) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn load<F>(mut f: F) -> $struct_name
|
pub fn load<F>(mut f: F) -> $struct_name
|
||||||
where F: FnMut(&std::ffi::CStr) -> *const std::os::raw::c_void
|
where F: FnMut(&std::ffi::CStr) -> *const std::os::raw::c_void
|
||||||
{
|
{
|
||||||
$struct_name {
|
$struct_name {
|
||||||
$(
|
$(
|
||||||
$name: unsafe {
|
$name: unsafe {
|
||||||
Self::log(format!("load: {}", stringify!($name)));
|
|
||||||
|
|
||||||
let dummy: *const std::ffi::c_void = std::ptr::null();
|
let dummy: *const std::ffi::c_void = std::ptr::null();
|
||||||
|
|
||||||
let name = std::ffi::CStr::from_bytes_with_nul_unchecked(concat!(stringify!($name), "\0").as_bytes());
|
let name = std::ffi::CStr::from_bytes_with_nul_unchecked(concat!(stringify!($name), "\0").as_bytes());
|
||||||
|
|
|
@ -98,22 +98,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,
|
||||||
|
@ -121,37 +105,23 @@ impl Instance {
|
||||||
extensions: &[VkString],
|
extensions: &[VkString],
|
||||||
api_version: Option<u32>,
|
api_version: Option<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: queried StaticFunctions");
|
|
||||||
|
|
||||||
let instance_functions = InstanceFunctions::new(&static_functions, instance);
|
let instance_functions = InstanceFunctions::new(&static_functions, instance);
|
||||||
|
|
||||||
log("Instance::preinitialized: queried InstanceFunctions");
|
|
||||||
|
|
||||||
let instance_wsi_functions = InstanceWSIFunctions::new(&static_functions, instance);
|
let instance_wsi_functions = InstanceWSIFunctions::new(&static_functions, instance);
|
||||||
|
|
||||||
log("Instance::preinitialized: queried InstanceWSIFunctions");
|
|
||||||
|
|
||||||
let physical_device_properties2_functions =
|
let physical_device_properties2_functions =
|
||||||
PhysicalDeviceProperties2Functions::new(&static_functions, instance);
|
PhysicalDeviceProperties2Functions::new(&static_functions, instance);
|
||||||
|
|
||||||
log("Instance::preinitialized: queried PhysicalDeviceProperties2Functions");
|
|
||||||
|
|
||||||
let debug_report_callback_functions =
|
let debug_report_callback_functions =
|
||||||
DebugReportCallbackFunctions::new(&static_functions, instance);
|
DebugReportCallbackFunctions::new(&static_functions, instance);
|
||||||
|
|
||||||
log("Instance::preinitialized: queried DebugReportCallbackFunctions");
|
|
||||||
|
|
||||||
let instance_extensions = InstanceExtensions::from_list(extensions);
|
let instance_extensions = InstanceExtensions::from_list(extensions);
|
||||||
|
|
||||||
log("Instance::preinitialized: queried InstanceExtensions");
|
|
||||||
|
|
||||||
let instance = Arc::new(Instance {
|
let instance = Arc::new(Instance {
|
||||||
_static_functions: static_functions,
|
_static_functions: static_functions,
|
||||||
_entry_functions: None,
|
_entry_functions: None,
|
||||||
|
|
Loading…
Reference in a new issue