From 2bb319b052b3b27b8a1a5b799eaeea27c516559c Mon Sep 17 00:00:00 2001 From: Joshua Groves Date: Tue, 14 Aug 2018 20:30:33 -0600 Subject: [PATCH] Log gfx errors --- libportability-gfx/src/impls.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libportability-gfx/src/impls.rs b/libportability-gfx/src/impls.rs index 63c1fa6..edc8c93 100644 --- a/libportability-gfx/src/impls.rs +++ b/libportability-gfx/src/impls.rs @@ -756,7 +756,10 @@ pub extern "C" fn gfxCreateDevice( VkResult::VK_SUCCESS } - Err(err) => conv::map_err_device_creation(err), + Err(err) => { + error!("{}", err); + conv::map_err_device_creation(err) + }, } } @@ -2101,6 +2104,11 @@ pub extern "C" fn gfxCreateGraphicsPipelines( }; if pipelines.iter().any(|p| p.is_err()) { + for pipeline in pipelines { + if let Err(e) = pipeline { + error!("{}", e); + } + } for op in out_pipelines { *op = Handle::null(); } @@ -2192,6 +2200,11 @@ pub extern "C" fn gfxCreateComputePipelines( }; if pipelines.iter().any(|p| p.is_err()) { + for pipeline in pipelines { + if let Err(e) = pipeline { + error!("{}", e); + } + } for op in out_pipelines { *op = Handle::null(); } @@ -2457,6 +2470,7 @@ pub extern "C" fn gfxAllocateDescriptorSets( for set in out_sets.iter_mut() { *set = Handle::null(); } + error!("{}", e); match e { pso::AllocationError::OutOfHostMemory => VkResult::VK_ERROR_OUT_OF_HOST_MEMORY, pso::AllocationError::OutOfDeviceMemory => VkResult::VK_ERROR_OUT_OF_DEVICE_MEMORY,