From a4a6ae38d46ea24988f3d8936c6cbf5efd93d9eb Mon Sep 17 00:00:00 2001 From: msiglreith Date: Tue, 27 Feb 2018 23:04:06 +0100 Subject: [PATCH 1/3] Add missing device proc entry points --- libportability-gfx/src/impls.rs | 81 +++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/libportability-gfx/src/impls.rs b/libportability-gfx/src/impls.rs index 93c0fac..8ee7ffd 100644 --- a/libportability-gfx/src/impls.rs +++ b/libportability-gfx/src/impls.rs @@ -267,6 +267,9 @@ pub extern "C" fn gfxGetDeviceProcAddr( }; proc_addr!{ name, + vkDestroyDevice, PFN_vkDestroyDevice => gfxDestroyDevice, + vkGetDeviceMemoryCommitment, PFN_vkGetDeviceMemoryCommitment => gfxGetDeviceMemoryCommitment, + vkCreateSwapchainKHR, PFN_vkCreateSwapchainKHR => gfxCreateSwapchainKHR, vkDestroySwapchainKHR, PFN_vkDestroySwapchainKHR => gfxDestroySwapchainKHR, vkGetSwapchainImagesKHR, PFN_vkGetSwapchainImagesKHR => gfxGetSwapchainImagesKHR, @@ -294,6 +297,7 @@ pub extern "C" fn gfxGetDeviceProcAddr( vkCreateImage, PFN_vkCreateImage => gfxCreateImage, vkDestroyImage, PFN_vkDestroyImage => gfxDestroyImage, vkGetImageMemoryRequirements, PFN_vkGetImageMemoryRequirements => gfxGetImageMemoryRequirements, + vkGetImageSparseMemoryRequirements, PFN_vkGetImageSparseMemoryRequirements => gfxGetImageSparseMemoryRequirements, vkBindImageMemory, PFN_vkBindImageMemory => gfxBindImageMemory, vkCreateImageView, PFN_vkCreateImageView => gfxCreateImageView, vkDestroyImageView, PFN_vkDestroyImageView => gfxDestroyImageView, @@ -319,9 +323,86 @@ pub extern "C" fn gfxGetDeviceProcAddr( vkDestroyFence, PFN_vkDestroyFence => gfxDestroyFence, vkWaitForFences, PFN_vkWaitForFences => gfxWaitForFences, vkResetFences, PFN_vkResetFences => gfxResetFences, + vkGetFenceStatus, PFN_vkGetFenceStatus => gfxGetFenceStatus, + + vkCreateSemaphore, PFN_vkCreateSemaphore => gfxCreateSemaphore, + vkDestroySemaphore, PFN_vkDestroySemaphore => gfxDestroySemaphore, + + vkCreateEvent, PFN_vkCreateEvent => gfxCreateEvent, + vkDestroyEvent, PFN_vkDestroyEvent => gfxDestroyEvent, + vkGetEventStatus, PFN_vkGetEventStatus => gfxGetEventStatus, + vkSetEvent, PFN_vkSetEvent => gfxSetEvent, + vkResetEvent, PFN_vkResetEvent => gfxResetEvent, + + vkResetEvent, PFN_vkResetEvent => gfxResetEvent, + vkResetEvent, PFN_vkResetEvent => gfxResetEvent, vkQueueSubmit, PFN_vkQueueSubmit => gfxQueueSubmit, + vkQueueBindSparse, PFN_vkQueueBindSparse => gfxQueueBindSparse, + vkQueueWaitIdle, PFN_vkQueueWaitIdle => gfxQueueWaitIdle, + vkDeviceWaitIdle, PFN_vkDeviceWaitIdle => gfxDeviceWaitIdle, + vkCreateQueryPool, PFN_vkCreateQueryPool => gfxCreateQueryPool, + vkDestroyQueryPool, PFN_vkDestroyQueryPool => gfxDestroyQueryPool, + vkGetQueryPoolResults, PFN_vkGetQueryPoolResults => gfxGetQueryPoolResults, + vkCreateBufferView, PFN_vkCreateBufferView => gfxCreateBufferView, + vkDestroyBufferView, PFN_vkDestroyBufferView => gfxDestroyBufferView, + vkGetImageSubresourceLayout, PFN_vkGetImageSubresourceLayout => gfxGetImageSubresourceLayout, + vkCreatePipelineCache, PFN_vkCreatePipelineCache => gfxCreatePipelineCache, + vkDestroyPipelineCache, PFN_vkDestroyPipelineCache => gfxDestroyPipelineCache, + vkGetPipelineCacheData, PFN_vkGetPipelineCacheData => gfxGetPipelineCacheData, + vkMergePipelineCaches, PFN_vkMergePipelineCaches => gfxMergePipelineCaches, + vkCreateComputePipelines, PFN_vkCreateComputePipelines => gfxCreateComputePipelines, + vkCreateDescriptorSetLayout, PFN_vkCreateDescriptorSetLayout => gfxCreateDescriptorSetLayout, + vkDestroyDescriptorSetLayout, PFN_vkDestroyDescriptorSetLayout => gfxDestroyDescriptorSetLayout, + vkCreateDescriptorPool, PFN_vkCreateDescriptorPool => gfxCreateDescriptorPool, + vkDestroyDescriptorPool, PFN_vkDestroyDescriptorPool => gfxDestroyDescriptorPool, + vkResetDescriptorPool, PFN_vkResetDescriptorPool => gfxResetDescriptorPool, + vkAllocateDescriptorSets, PFN_vkAllocateDescriptorSets => gfxAllocateDescriptorSets, + vkFreeDescriptorSets, PFN_vkFreeDescriptorSets => gfxFreeDescriptorSets, + vkUpdateDescriptorSets, PFN_vkUpdateDescriptorSets => gfxUpdateDescriptorSets, + vkGetRenderAreaGranularity, PFN_vkGetRenderAreaGranularity => gfxGetRenderAreaGranularity, + vkResetCommandPool, PFN_vkResetCommandPool => gfxResetCommandPool, + vkResetCommandBuffer, PFN_vkResetCommandBuffer => gfxResetCommandBuffer, + vkCmdBindPipeline, PFN_vkCmdBindPipeline => gfxCmdBindPipeline, + vkCmdSetViewport, PFN_vkCmdSetViewport => gfxCmdSetViewport, + vkCmdSetScissor, PFN_vkCmdSetScissor => gfxCmdSetScissor, + vkCmdSetLineWidth, PFN_vkCmdSetLineWidth => gfxCmdSetLineWidth, + vkCmdSetDepthBias, PFN_vkCmdSetDepthBias => gfxCmdSetDepthBias, + vkCmdSetBlendConstants, PFN_vkCmdSetBlendConstants => gfxCmdSetBlendConstants, + vkCmdSetDepthBounds, PFN_vkCmdSetDepthBounds => gfxCmdSetDepthBounds, + vkCmdSetStencilCompareMask, PFN_vkCmdSetStencilCompareMask => gfxCmdSetStencilCompareMask, + vkCmdSetStencilWriteMask, PFN_vkCmdSetStencilWriteMask => gfxCmdSetStencilWriteMask, + vkCmdSetStencilReference, PFN_vkCmdSetStencilReference => gfxCmdSetStencilReference, + vkCmdBindDescriptorSets, PFN_vkCmdBindDescriptorSets => gfxCmdBindDescriptorSets, + vkCmdBindIndexBuffer, PFN_vkCmdBindIndexBuffer => gfxCmdBindIndexBuffer, + vkCmdBindVertexBuffers, PFN_vkCmdBindVertexBuffers => gfxCmdBindVertexBuffers, + vkCmdDrawIndexed, PFN_vkCmdDrawIndexed => gfxCmdDrawIndexed, + vkCmdDrawIndirect, PFN_vkCmdDrawIndirect => gfxCmdDrawIndirect, + vkCmdDrawIndexedIndirect, PFN_vkCmdDrawIndexedIndirect => gfxCmdDrawIndexedIndirect, + vkCmdDispatch, PFN_vkCmdDispatch => gfxCmdDispatch, + vkCmdDispatchIndirect, PFN_vkCmdDispatchIndirect => gfxCmdDispatchIndirect, + vkCmdCopyBuffer, PFN_vkCmdCopyBuffer => gfxCmdCopyBuffer, + vkCmdCopyImage, PFN_vkCmdCopyImage => gfxCmdCopyImage, + vkCmdBlitImage, PFN_vkCmdBlitImage => gfxCmdBlitImage, + vkCmdCopyBufferToImage, PFN_vkCmdCopyBufferToImage => gfxCmdCopyBufferToImage, + vkCmdUpdateBuffer, PFN_vkCmdUpdateBuffer => gfxCmdUpdateBuffer, + vkCmdFillBuffer, PFN_vkCmdFillBuffer => gfxCmdFillBuffer, + vkCmdClearColorImage, PFN_vkCmdClearColorImage => gfxCmdClearColorImage, + vkCmdClearDepthStencilImage, PFN_vkCmdClearDepthStencilImage => gfxCmdClearDepthStencilImage, + vkCmdClearAttachments, PFN_vkCmdClearAttachments => gfxCmdClearAttachments, + vkCmdResolveImage, PFN_vkCmdResolveImage => gfxCmdResolveImage, + vkCmdSetEvent, PFN_vkCmdSetEvent => gfxCmdSetEvent, + vkCmdResetEvent, PFN_vkCmdResetEvent => gfxCmdResetEvent, + vkCmdWaitEvents, PFN_vkCmdWaitEvents => gfxCmdWaitEvents, + vkCmdBeginQuery, PFN_vkCmdBeginQuery => gfxCmdBeginQuery, + vkCmdEndQuery, PFN_vkCmdEndQuery => gfxCmdEndQuery, + vkCmdResetQueryPool, PFN_vkCmdResetQueryPool => gfxCmdResetQueryPool, + vkCmdWriteTimestamp, PFN_vkCmdWriteTimestamp => gfxCmdWriteTimestamp, + vkCmdCopyQueryPoolResults, PFN_vkCmdCopyQueryPoolResults => gfxCmdCopyQueryPoolResults, + vkCmdPushConstants, PFN_vkCmdPushConstants => gfxCmdPushConstants, + vkCmdNextSubpass, PFN_vkCmdNextSubpass => gfxCmdNextSubpass, + vkCmdExecuteCommands, PFN_vkCmdExecuteCommands => gfxCmdExecuteCommands, vkCmdPipelineBarrier, PFN_vkCmdPipelineBarrier => gfxCmdPipelineBarrier, vkCmdBeginRenderPass, PFN_vkCmdBeginRenderPass => gfxCmdBeginRenderPass, vkCmdEndRenderPass, PFN_vkCmdEndRenderPass => gfxCmdEndRenderPass, From 9cfbe8d243d4e0c784b00529ba1d09169e2eddc0 Mon Sep 17 00:00:00 2001 From: msiglreith Date: Tue, 27 Feb 2018 23:10:12 +0100 Subject: [PATCH 2/3] Fix build on non-unix systems --- libportability-gfx/src/impls.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libportability-gfx/src/impls.rs b/libportability-gfx/src/impls.rs index 8ee7ffd..6651a43 100644 --- a/libportability-gfx/src/impls.rs +++ b/libportability-gfx/src/impls.rs @@ -3158,7 +3158,7 @@ pub extern "C" fn gfxCreateXcbSurfaceKHR( pSurface: *mut VkSurfaceKHR, ) -> VkResult { let info = unsafe { &*pCreateInfo }; - #[cfg(feature = "vulkan")] + #[cfg(all(feature = "vulkan", target_os = "linux"))] { unsafe { assert_eq!(info.flags, 0); @@ -3169,7 +3169,7 @@ pub extern "C" fn gfxCreateXcbSurfaceKHR( VkResult::VK_SUCCESS } } - #[cfg(not(feature = "vulkan"))] + #[cfg(not(all(feature = "vulkan", target_os = "linux")))] unreachable!() } #[inline] From 965f2a2c9e038514ebbc932a9fb7e9f2327ef89f Mon Sep 17 00:00:00 2001 From: msiglreith Date: Wed, 28 Feb 2018 13:56:05 +0100 Subject: [PATCH 3/3] Remove duplicate reset event entry points --- libportability-gfx/src/impls.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/libportability-gfx/src/impls.rs b/libportability-gfx/src/impls.rs index 6651a43..7d53dc7 100644 --- a/libportability-gfx/src/impls.rs +++ b/libportability-gfx/src/impls.rs @@ -334,9 +334,6 @@ pub extern "C" fn gfxGetDeviceProcAddr( vkSetEvent, PFN_vkSetEvent => gfxSetEvent, vkResetEvent, PFN_vkResetEvent => gfxResetEvent, - vkResetEvent, PFN_vkResetEvent => gfxResetEvent, - vkResetEvent, PFN_vkResetEvent => gfxResetEvent, - vkQueueSubmit, PFN_vkQueueSubmit => gfxQueueSubmit, vkQueueBindSparse, PFN_vkQueueBindSparse => gfxQueueBindSparse, vkQueueWaitIdle, PFN_vkQueueWaitIdle => gfxQueueWaitIdle,