mirror of
https://github.com/italicsjenga/portability.git
synced 2024-11-26 08:51:31 +11:00
Merge #39
39: Basic env_logger hookup r=msiglreith a=kvark Not CI tested but fairly simple and nothing bad will happen if it breaks. Developer can manually enable the feature for local debugging.
This commit is contained in:
commit
c59ea3b5c7
|
@ -8,6 +8,7 @@ name = "portability_gfx"
|
|||
|
||||
[features]
|
||||
default = []
|
||||
#default = ["env_logger"] # uncomment for debugging
|
||||
dx12 = ["gfx-backend-dx12"]
|
||||
vulkan = ["gfx-backend-vulkan"]
|
||||
|
||||
|
@ -15,6 +16,10 @@ vulkan = ["gfx-backend-vulkan"]
|
|||
lazy_static = "1.0"
|
||||
log = "0.4"
|
||||
|
||||
[dependencies.env_logger]
|
||||
version = "0.5"
|
||||
optional = true
|
||||
|
||||
[dependencies.gfx-hal]
|
||||
git = "https://github.com/gfx-rs/gfx"
|
||||
rev = "070e0cee47ae6f0c395a3402fd6f889c1315ef3e"
|
||||
|
|
|
@ -48,6 +48,12 @@ pub extern "C" fn gfxCreateInstance(
|
|||
_pAllocator: *const VkAllocationCallbacks,
|
||||
pInstance: *mut VkInstance,
|
||||
) -> VkResult {
|
||||
//Note: is this the best place to enable logging?
|
||||
#[cfg(feature = "env_logger")]
|
||||
{
|
||||
use env_logger;
|
||||
env_logger::init();
|
||||
}
|
||||
let instance = back::Instance::create("portability", 1);
|
||||
unsafe { *pInstance = Handle::new(instance) };
|
||||
VkResult::VK_SUCCESS
|
||||
|
|
|
@ -13,6 +13,8 @@ extern crate gfx_backend_vulkan as back;
|
|||
extern crate lazy_static;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[cfg(feature = "env_logger")]
|
||||
extern crate env_logger;
|
||||
|
||||
mod conv;
|
||||
mod handle;
|
||||
|
|
Loading…
Reference in a new issue