prepare more function loading

This commit is contained in:
hodasemi 2023-01-10 19:41:45 +01:00
parent 98282c5a42
commit b35b12d1dc

View file

@ -118,157 +118,156 @@ fn get_function(function_name: *const c_char) -> PFN_vkVoidFunction {
); );
cmp_device_fn!(s, { cmp_device_fn!(s, {
[device_functions, vkGetDeviceQueue], [device_functions, vkGetDeviceQueue],
[device_functions, vkQueueSubmit], [device_functions, vkQueueSubmit],
[device_functions, vkQueueWaitIdle], [device_functions, vkQueueWaitIdle],
[device_functions, vkDeviceWaitIdle], [device_functions, vkDeviceWaitIdle],
[device_functions, vkAllocateMemory], [device_functions, vkAllocateMemory],
[device_functions, vkFreeMemory], [device_functions, vkFreeMemory],
[device_functions, vkMapMemory], [device_functions, vkMapMemory],
[device_functions, vkUnmapMemory], [device_functions, vkUnmapMemory],
[device_functions, vkBindBufferMemory], [device_functions, vkBindBufferMemory],
[device_functions, vkBindImageMemory], [device_functions, vkBindImageMemory],
[device_functions, vkGetBufferMemoryRequirements], [device_functions, vkGetBufferMemoryRequirements],
[device_functions, vkGetImageMemoryRequirements], [device_functions, vkGetImageMemoryRequirements],
[device_functions, vkCreateFence], [device_functions, vkCreateFence],
[device_functions, vkDestroyFence], [device_functions, vkDestroyFence],
[device_functions, vkResetFences], [device_functions, vkResetFences],
[device_functions, vkWaitForFences], [device_functions, vkWaitForFences],
[device_functions, vkCreateSemaphore], [device_functions, vkCreateSemaphore],
[device_functions, vkDestroySemaphore], [device_functions, vkDestroySemaphore],
[device_functions, vkCreateEvent], [device_functions, vkCreateEvent],
[device_functions, vkDestroyEvent], [device_functions, vkDestroyEvent],
[device_functions, vkGetEventStatus], [device_functions, vkGetEventStatus],
[device_functions, vkSetEvent], [device_functions, vkSetEvent],
[device_functions, vkResetEvent], [device_functions, vkResetEvent],
[device_functions, vkCreateBuffer], [device_functions, vkCreateBuffer],
[device_functions, vkDestroyBuffer], [device_functions, vkDestroyBuffer],
[device_functions, vkCreateBufferView], [device_functions, vkCreateBufferView],
[device_functions, vkDestroyBufferView], [device_functions, vkDestroyBufferView],
[device_functions, vkCreateImage], [device_functions, vkCreateImage],
[device_functions, vkDestroyImage], [device_functions, vkDestroyImage],
[device_functions, vkGetImageSubresourceLayout], [device_functions, vkGetImageSubresourceLayout],
[device_functions, vkCreateImageView], [device_functions, vkCreateImageView],
[device_functions, vkDestroyImageView], [device_functions, vkDestroyImageView],
[device_functions, vkCreateShaderModule], [device_functions, vkCreateShaderModule],
[device_functions, vkDestroyShaderModule], [device_functions, vkDestroyShaderModule],
[device_functions, vkCreatePipelineCache], [device_functions, vkCreatePipelineCache],
[device_functions, vkDestroyPipelineCache], [device_functions, vkDestroyPipelineCache],
[device_functions, vkGetPipelineCacheData], [device_functions, vkGetPipelineCacheData],
[device_functions, vkMergePipelineCaches], [device_functions, vkMergePipelineCaches],
[device_functions, vkCreateGraphicsPipelines], [device_functions, vkCreateGraphicsPipelines],
[device_functions, vkCreateComputePipelines], [device_functions, vkCreateComputePipelines],
[device_functions, vkDestroyPipeline], [device_functions, vkDestroyPipeline],
[device_functions, vkCreatePipelineLayout], [device_functions, vkCreatePipelineLayout],
[device_functions, vkDestroyPipelineLayout], [device_functions, vkDestroyPipelineLayout],
[device_functions, vkCreateSampler], [device_functions, vkCreateSampler],
[device_functions, vkDestroySampler], [device_functions, vkDestroySampler],
[device_functions, vkCreateDescriptorSetLayout], [device_functions, vkCreateDescriptorSetLayout],
[device_functions, vkDestroyDescriptorSetLayout], [device_functions, vkDestroyDescriptorSetLayout],
[device_functions, vkCreateDescriptorPool], [device_functions, vkCreateDescriptorPool],
[device_functions, vkDestroyDescriptorPool], [device_functions, vkDestroyDescriptorPool],
[device_functions, vkResetDescriptorPool], [device_functions, vkResetDescriptorPool],
[device_functions, vkAllocateDescriptorSets], [device_functions, vkAllocateDescriptorSets],
[device_functions, vkFreeDescriptorSets], [device_functions, vkFreeDescriptorSets],
[device_functions, vkUpdateDescriptorSets], [device_functions, vkUpdateDescriptorSets],
[device_functions, vkCreateFramebuffer], [device_functions, vkCreateFramebuffer],
[device_functions, vkDestroyFramebuffer], [device_functions, vkDestroyFramebuffer],
[device_functions, vkCreateRenderPass], [device_functions, vkCreateRenderPass],
[device_functions, vkDestroyRenderPass], [device_functions, vkDestroyRenderPass],
[device_functions, vkCreateCommandPool], [device_functions, vkCreateCommandPool],
[device_functions, vkDestroyCommandPool], [device_functions, vkDestroyCommandPool],
[device_functions, vkResetCommandPool], [device_functions, vkResetCommandPool],
[device_functions, vkAllocateCommandBuffers], [device_functions, vkAllocateCommandBuffers],
[device_functions, vkFreeCommandBuffers], [device_functions, vkFreeCommandBuffers],
[device_functions, vkBeginCommandBuffer], [device_functions, vkBeginCommandBuffer],
[device_functions, vkEndCommandBuffer], [device_functions, vkEndCommandBuffer],
[device_functions, vkResetCommandBuffer], [device_functions, vkResetCommandBuffer],
[device_functions, vkCmdBindPipeline], [device_functions, vkCmdBindPipeline],
[device_functions, vkCmdSetViewport], [device_functions, vkCmdSetViewport],
[device_functions, vkCmdSetScissor], [device_functions, vkCmdSetScissor],
[device_functions, vkCmdSetLineWidth], [device_functions, vkCmdSetLineWidth],
[device_functions, vkCmdSetDepthBias], [device_functions, vkCmdSetDepthBias],
[device_functions, vkCmdSetBlendConstants], [device_functions, vkCmdSetBlendConstants],
[device_functions, vkCmdSetDepthBounds], [device_functions, vkCmdSetDepthBounds],
[device_functions, vkCmdSetStencilCompareMask], [device_functions, vkCmdSetStencilCompareMask],
[device_functions, vkCmdSetStencilWriteMask], [device_functions, vkCmdSetStencilWriteMask],
[device_functions, vkCmdSetStencilReference], [device_functions, vkCmdSetStencilReference],
[device_functions, vkCmdBindDescriptorSets], [device_functions, vkCmdBindDescriptorSets],
[device_functions, vkCmdBindIndexBuffer], [device_functions, vkCmdBindIndexBuffer],
[device_functions, vkCmdBindVertexBuffers], [device_functions, vkCmdBindVertexBuffers],
[device_functions, vkCmdDraw], [device_functions, vkCmdDraw],
[device_functions, vkCmdDispatch], [device_functions, vkCmdDispatch],
[device_functions, vkCmdCopyBuffer], [device_functions, vkCmdCopyBuffer],
[device_functions, vkCmdCopyImage], [device_functions, vkCmdCopyImage],
[device_functions, vkCmdBlitImage], [device_functions, vkCmdBlitImage],
[device_functions, vkCmdCopyBufferToImage], [device_functions, vkCmdCopyBufferToImage],
[device_functions, vkCmdCopyImageToBuffer], [device_functions, vkCmdCopyImageToBuffer],
[device_functions, vkCmdUpdateBuffer], [device_functions, vkCmdUpdateBuffer],
[device_functions, vkCmdFillBuffer], [device_functions, vkCmdFillBuffer],
[device_functions, vkCmdClearColorImage], [device_functions, vkCmdClearColorImage],
[device_functions, vkCmdClearDepthStencilImage], [device_functions, vkCmdClearDepthStencilImage],
[device_functions, vkCmdClearAttachments], [device_functions, vkCmdClearAttachments],
[device_functions, vkCmdResolveImage], [device_functions, vkCmdResolveImage],
[device_functions, vkCmdSetEvent], [device_functions, vkCmdSetEvent],
[device_functions, vkCmdResetEvent], [device_functions, vkCmdResetEvent],
[device_functions, vkCmdWaitEvents], [device_functions, vkCmdWaitEvents],
[device_functions, vkCmdPipelineBarrier], [device_functions, vkCmdPipelineBarrier],
[device_functions, vkCmdPushConstants], [device_functions, vkCmdPushConstants],
[device_functions, vkCmdBeginRenderPass], [device_functions, vkCmdBeginRenderPass],
[device_functions, vkCmdNextSubpass], [device_functions, vkCmdNextSubpass],
[device_functions, vkCmdEndRenderPass], [device_functions, vkCmdEndRenderPass],
[device_functions, vkCmdExecuteCommands], [device_functions, vkCmdExecuteCommands],
[device_functions, vkTrimCommandPool], [device_functions, vkTrimCommandPool],
[device_functions, vkGetBufferDeviceAddress], [device_functions, vkGetBufferDeviceAddress],
[device_functions, vkGetBufferMemoryRequirements2], [device_functions, vkGetBufferMemoryRequirements2],
[device_functions, vkGetImageMemoryRequirements2], [device_functions, vkGetImageMemoryRequirements2],
[device_functions, vkBindBufferMemory2], [device_functions, vkBindBufferMemory2],
[device_functions, vkBindImageMemory2], [device_functions, vkBindImageMemory2],
[device_wsi_functions, vkCreateSwapchainKHR], [device_wsi_functions, vkCreateSwapchainKHR],
[device_wsi_functions, vkDestroySwapchainKHR], [device_wsi_functions, vkDestroySwapchainKHR],
[device_wsi_functions, vkAcquireNextImageKHR], [device_wsi_functions, vkAcquireNextImageKHR],
[device_wsi_functions, vkQueuePresentKHR], [device_wsi_functions, vkQueuePresentKHR],
[device_wsi_functions, vkGetSwapchainImagesKHR], [device_wsi_functions, vkGetSwapchainImagesKHR],
[acceleration_structure_functions, vkBuildAccelerationStructuresKHR], [acceleration_structure_functions, vkBuildAccelerationStructuresKHR],
[acceleration_structure_functions, vkCmdBuildAccelerationStructuresIndirectKHR], [acceleration_structure_functions, vkCmdBuildAccelerationStructuresIndirectKHR],
[acceleration_structure_functions, vkCmdBuildAccelerationStructuresKHR], [acceleration_structure_functions, vkCmdBuildAccelerationStructuresKHR],
[acceleration_structure_functions, vkCmdCopyAccelerationStructureKHR], [acceleration_structure_functions, vkCmdCopyAccelerationStructureKHR],
[acceleration_structure_functions, vkCmdCopyAccelerationStructureToMemoryKHR], [acceleration_structure_functions, vkCmdCopyAccelerationStructureToMemoryKHR],
[acceleration_structure_functions, vkCmdCopyMemoryToAccelerationStructureKHR], [acceleration_structure_functions, vkCmdCopyMemoryToAccelerationStructureKHR],
[acceleration_structure_functions, vkCmdWriteAccelerationStructuresPropertiesKHR], [acceleration_structure_functions, vkCmdWriteAccelerationStructuresPropertiesKHR],
[acceleration_structure_functions, vkCopyAccelerationStructureKHR], [acceleration_structure_functions, vkCopyAccelerationStructureKHR],
[acceleration_structure_functions, vkCopyAccelerationStructureToMemoryKHR], [acceleration_structure_functions, vkCopyAccelerationStructureToMemoryKHR],
[acceleration_structure_functions, vkCopyMemoryToAccelerationStructureKHR], [acceleration_structure_functions, vkCopyMemoryToAccelerationStructureKHR],
[acceleration_structure_functions, vkCreateAccelerationStructureKHR], [acceleration_structure_functions, vkCreateAccelerationStructureKHR],
[acceleration_structure_functions, vkDestroyAccelerationStructureKHR], [acceleration_structure_functions, vkDestroyAccelerationStructureKHR],
[acceleration_structure_functions, vkGetAccelerationStructureBuildSizesKHR], [acceleration_structure_functions, vkGetAccelerationStructureBuildSizesKHR],
[acceleration_structure_functions, vkGetAccelerationStructureDeviceAddressKHR], [acceleration_structure_functions, vkGetAccelerationStructureDeviceAddressKHR],
[acceleration_structure_functions, vkGetDeviceAccelerationStructureCompatibilityKHR], [acceleration_structure_functions, vkGetDeviceAccelerationStructureCompatibilityKHR],
[acceleration_structure_functions, vkWriteAccelerationStructuresPropertiesKHR], [acceleration_structure_functions, vkWriteAccelerationStructuresPropertiesKHR],
[ray_tracing_pipeline_functions, vkCmdSetRayTracingPipelineStackSizeKHR], [ray_tracing_pipeline_functions, vkCmdSetRayTracingPipelineStackSizeKHR],
[ray_tracing_pipeline_functions, vkCmdTraceRaysIndirectKHR], [ray_tracing_pipeline_functions, vkCmdTraceRaysIndirectKHR],
[ray_tracing_pipeline_functions, vkCmdTraceRaysKHR], [ray_tracing_pipeline_functions, vkCmdTraceRaysKHR],
[ray_tracing_pipeline_functions, vkCreateRayTracingPipelinesKHR], [ray_tracing_pipeline_functions, vkCreateRayTracingPipelinesKHR],
[ray_tracing_pipeline_functions, vkGetRayTracingCaptureReplayShaderGroupHandlesKHR], [ray_tracing_pipeline_functions, vkGetRayTracingCaptureReplayShaderGroupHandlesKHR],
[ray_tracing_pipeline_functions, vkGetRayTracingShaderGroupHandlesKHR], [ray_tracing_pipeline_functions, vkGetRayTracingShaderGroupHandlesKHR],
[ray_tracing_pipeline_functions, vkGetRayTracingShaderGroupStackSizeKHR], [ray_tracing_pipeline_functions, vkGetRayTracingShaderGroupStackSizeKHR],
[maintenance3_functions, vkGetDescriptorSetLayoutSupport], [maintenance3_functions, vkGetDescriptorSetLayoutSupport],
}
}); );
match s { match s {
"vkCreateDevice" => Functions::CreateDevice(create_device), "vkCreateDevice" => return Functions::CreateDevice(create_device).convert(),
"vkDestroyDevice" => Functions::DestroyDevice(destroy_device), "vkDestroyDevice" => return Functions::DestroyDevice(destroy_device).convert(),
"vkCreateInstance" => Functions::CreateInstance(create_instance), "vkCreateInstance" => return Functions::CreateInstance(create_instance).convert(),
"vkDestroyInstance" => Functions::DestroyInstance(destroy_instance), "vkDestroyInstance" => return Functions::DestroyInstance(destroy_instance).convert(),
_ => { _ => (),
write_log(format!("\trequested fn: {}", s)); };
write_log(format!("\t-> not found"));
Functions::Null write_log(format!("\trequested fn: {}", s));
} write_log(format!("\t-> not found"));
} Functions::Null.convert()
.convert()
} }
extern "system" fn create_instance( extern "system" fn create_instance(