mirror of
https://github.com/italicsjenga/portability.git
synced 2024-11-27 01:11:32 +11:00
Fix build and enumerating physical devices
This commit is contained in:
parent
31d9ddc75f
commit
d812b10a72
|
@ -44,6 +44,13 @@ pub extern "C" fn gfxEnumeratePhysicalDevices(
|
||||||
pPhysicalDevices: *mut VkPhysicalDevice,
|
pPhysicalDevices: *mut VkPhysicalDevice,
|
||||||
) -> VkResult {
|
) -> VkResult {
|
||||||
let adapters = instance.enumerate_adapters();
|
let adapters = instance.enumerate_adapters();
|
||||||
|
|
||||||
|
// If NULL, number of devices is returned.
|
||||||
|
if pPhysicalDevices.is_null() {
|
||||||
|
unsafe { *pPhysicalDeviceCount = adapters.len() as _ };
|
||||||
|
return VkResult::VK_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
let output = unsafe { slice::from_raw_parts_mut(pPhysicalDevices, *pPhysicalDeviceCount as _) };
|
let output = unsafe { slice::from_raw_parts_mut(pPhysicalDevices, *pPhysicalDeviceCount as _) };
|
||||||
let count = cmp::min(adapters.len(), output.len());
|
let count = cmp::min(adapters.len(), output.len());
|
||||||
|
|
||||||
|
@ -1118,6 +1125,7 @@ pub extern "C" fn gfxCreateGraphicsPipelines(
|
||||||
let input_state = unsafe { &*info.pInputAssemblyState };
|
let input_state = unsafe { &*info.pInputAssemblyState };
|
||||||
let tessellation_state = shaders
|
let tessellation_state = shaders
|
||||||
.hull
|
.hull
|
||||||
|
.as_ref()
|
||||||
.map(|_| unsafe { &*info.pTessellationState });
|
.map(|_| unsafe { &*info.pTessellationState });
|
||||||
|
|
||||||
assert_eq!(input_state.primitiveRestartEnable, VK_FALSE); // TODO
|
assert_eq!(input_state.primitiveRestartEnable, VK_FALSE); // TODO
|
||||||
|
|
Loading…
Reference in a new issue