mirror of
https://github.com/italicsjenga/portability.git
synced 2024-11-22 15:01:31 +11:00
Update gfx-rs, Linux numbers, properly release device references
This commit is contained in:
parent
64faf13e00
commit
cfe1f11ad3
|
@ -7,10 +7,10 @@ This is a prototype library implementing [Vulkan Portability Initiative](https:/
|
|||
## Vulkan CTS coverage
|
||||
|
||||
| gfx-rs Backend | Total cases | Pass | Fail | Quality warning | Compatibility warning | Not supported | Resource error | Internal error | Timeout | Crash |
|
||||
| -------------- | -- | -- | -- | - | - | - | - | - | - | - |
|
||||
| *Vulkan* | 3742 | 1393 | 101 | 0 | 0 | 2248 | 0 | 0 | 0 | 0 |
|
||||
| *DX12* | 3563 | 1243 | 73 | 0 | 0 | 2247 | 0 | 0 | 0 | 0 |
|
||||
| *Metal* | 3710 | 1260 | 66 | 0 | 0 | 2384 | 0 | 0 | 0 | 0 |
|
||||
| -------- | ---- | ---- | --- | -- | - | ---- | - | - | - | - |
|
||||
| *Vulkan* | 3914 | 1516 | 120 | 30 | 0 | 2248 | 0 | 0 | 0 | 0 |
|
||||
| *DX12* | 3563 | 1243 | 73 | 0 | 0 | 2247 | 0 | 0 | 0 | 0 |
|
||||
| *Metal* | 3710 | 1260 | 66 | 0 | 0 | 2384 | 0 | 0 | 0 | 0 |
|
||||
|
||||
Currently stopping with:
|
||||
> Unable to create Vulkan instance: VkError(ErrorIncompatibleDriver)
|
||||
|
|
|
@ -548,8 +548,13 @@ pub extern "C" fn gfxCreateDevice(
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub extern "C" fn gfxDestroyDevice(device: VkDevice, _pAllocator: *const VkAllocationCallbacks) {
|
||||
let _ = device.unwrap(); //TODO?
|
||||
pub extern "C" fn gfxDestroyDevice(gpu: VkDevice, _pAllocator: *const VkAllocationCallbacks) {
|
||||
// release all the owned command queues
|
||||
for (_, family) in gpu.unwrap().queues {
|
||||
for queue in family {
|
||||
let _ = queue.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
|
@ -1876,7 +1881,16 @@ pub extern "C" fn gfxAllocateDescriptorSets(
|
|||
slice::from_raw_parts_mut(pDescriptorSets, info.descriptorSetCount as _)
|
||||
};
|
||||
for (set, raw_set) in sets.iter_mut().zip(descriptor_sets.into_iter()) {
|
||||
*set = Handle::new(raw_set);
|
||||
*set = match raw_set {
|
||||
Ok(set) => Handle::new(set),
|
||||
Err(e) => return match e {
|
||||
pso::AllocationError::OutOfHostMemory => VkResult::VK_ERROR_OUT_OF_HOST_MEMORY,
|
||||
pso::AllocationError::OutOfDeviceMemory => VkResult::VK_ERROR_OUT_OF_DEVICE_MEMORY,
|
||||
pso::AllocationError::OutOfPoolMemory => VkResult::VK_ERROR_OUT_OF_POOL_MEMORY_KHR,
|
||||
pso::AllocationError::IncompatibleLayout => VkResult::VK_ERROR_DEVICE_LOST,
|
||||
pso::AllocationError::FragmentedPool => VkResult::VK_ERROR_FRAGMENTED_POOL,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
VkResult::VK_SUCCESS
|
||||
|
@ -2304,17 +2318,15 @@ pub extern "C" fn gfxAllocateCommandBuffers(
|
|||
#[inline]
|
||||
pub extern "C" fn gfxFreeCommandBuffers(
|
||||
_gpu: VkDevice,
|
||||
commandPool: VkCommandPool,
|
||||
mut commandPool: VkCommandPool,
|
||||
commandBufferCount: u32,
|
||||
pCommandBuffers: *const VkCommandBuffer,
|
||||
) {
|
||||
// TODO:
|
||||
/*
|
||||
let buffer_slice = unsafe { slice::from_raw_parts(pCommandBuffers, commandBufferCount as _) };
|
||||
let buffers = buffer_slice.iter().map(|buffer| *buffer.unwrap()).collect();
|
||||
|
||||
let slice = unsafe {
|
||||
slice::from_raw_parts(pCommandBuffers, commandBufferCount as _)
|
||||
};
|
||||
let buffers = slice.iter().map(|buffer| *buffer.unwrap()).collect();
|
||||
unsafe { commandPool.free(buffers) };
|
||||
*/
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
@ -38,6 +38,7 @@ pub struct RawInstance {
|
|||
pub backend: back::Instance,
|
||||
pub adapters: Vec<VkPhysicalDevice>,
|
||||
}
|
||||
|
||||
pub type VkInstance = Handle<RawInstance>;
|
||||
pub type VkDevice = DispatchHandle<Gpu<B>>;
|
||||
pub type VkQueue = DispatchHandle<<B as hal::Backend>::CommandQueue>;
|
||||
|
|
Loading…
Reference in a new issue