SharpVk icon indicating copy to clipboard operation
SharpVk copied to clipboard

VK API Commands should be correctly generated, compiled & executed

Open FacticiusVir opened this issue 9 years ago • 9 comments

These commands are successfully generated but need exercising in sample code:

  • Device initialization
  • [x] vkCreateInstance
  • [x] vkDestroyInstance
  • [x] vkEnumeratePhysicalDevices
  • [x] vkGetPhysicalDeviceFeatures
  • [x] vkGetPhysicalDeviceFormatProperties
  • [x] vkGetPhysicalDeviceImageFormatProperties
  • [x] vkGetPhysicalDeviceProperties
  • [x] vkGetPhysicalDeviceQueueFamilyProperties
  • [x] vkGetPhysicalDeviceMemoryProperties
  • [x] vkGetInstanceProcAddr
  • [x] vkGetDeviceProcAddr
  • Device commands
    • [x] vkCreateDevice
    • [x] vkDestroyDevice
  • Extension discovery commands
    • [x] vkEnumerateInstanceExtensionProperties
    • [x] vkEnumerateDeviceExtensionProperties
  • Layer discovery commands
    • [x] vkEnumerateInstanceLayerProperties
    • [x] vkEnumerateDeviceLayerProperties
  • Queue commands
    • [x] vkGetDeviceQueue
    • [x] vkQueueSubmit
    • [x] vkQueueWaitIdle
    • [x] vkDeviceWaitIdle
  • Memory commands
    • [x] vkAllocateMemory
    • [x] vkFreeMemory
    • [x] vkMapMemory
    • [x] vkUnmapMemory
    • [ ] vkFlushMappedMemoryRanges
    • [ ] vkInvalidateMappedMemoryRanges
    • [x] vkGetDeviceMemoryCommitment
  • Memory management API commands
    • [x] vkBindBufferMemory
    • [x] vkBindImageMemory
    • [x] vkGetBufferMemoryRequirements
    • [x] vkGetImageMemoryRequirements
  • Sparse resource memory management API commands
    • [ ] vkGetImageSparseMemoryRequirements
    • [ ] vkGetPhysicalDeviceSparseImageFormatProperties
    • [ ] vkQueueBindSparse
  • Fence commands
    • [ ] vkCreateFence
    • [ ] vkDestroyFence
    • [ ] vkResetFences
    • [ ] vkGetFenceStatus
    • [ ] vkWaitForFences
  • Queue semaphore commands
    • [x] vkCreateSemaphore
    • [x] vkDestroySemaphore
  • Event commands
    • [ ] vkCreateEvent
    • [ ] vkDestroyEvent
    • [ ] vkGetEventStatus
    • [ ] vkSetEvent
    • [ ] vkResetEvent
  • Query commands
    • [ ] vkCreateQueryPool
    • [ ] vkDestroyQueryPool
    • [ ] vkGetQueryPoolResults
  • Buffer commands
    • [x] vkCreateBuffer
    • [x] vkDestroyBuffer
  • Buffer view commands
    • [ ] vkCreateBufferView
    • [ ] vkDestroyBufferView
  • Image commands
    • [x] vkCreateImage
    • [x] vkDestroyImage
    • [ ] vkGetImageSubresourceLayout
  • Image view commands
    • [x] vkCreateImageView
    • [x] vkDestroyImageView
  • Shader commands
    • [x] vkCreateShaderModule
    • [x] vkDestroyShaderModule
  • Pipeline Cache commands
    • [ ] vkCreatePipelineCache
    • [ ] vkDestroyPipelineCache
    • [ ] vkGetPipelineCacheData
    • [ ] vkMergePipelineCaches
  • Pipeline commands
    • [x] vkCreateGraphicsPipelines
    • [x] vkCreateComputePipelines
    • [x] vkDestroyPipeline
  • Pipeline layout commands
    • [x] vkCreatePipelineLayout
    • [x] vkDestroyPipelineLayout
  • Sampler commands
    • [x] vkCreateSampler
    • [x] vkDestroySampler
  • Descriptor set commands
    • [x] vkCreateDescriptorSetLayout
    • [x] vkDestroyDescriptorSetLayout
    • [x] vkCreateDescriptorPool
    • [x] vkDestroyDescriptorPool
    • [ ] vkResetDescriptorPool
    • [x] vkAllocateDescriptorSets
    • [x] vkFreeDescriptorSets
    • [x] vkUpdateDescriptorSets
  • Pass commands
    • [x] vkCreateFramebuffer
    • [x] vkDestroyFramebuffer
    • [x] vkCreateRenderPass
    • [x] vkDestroyRenderPass
    • [ ] vkGetRenderAreaGranularity
  • Command pool commands
    • [x] vkCreateCommandPool
    • [x] vkDestroyCommandPool
    • [x] vkResetCommandPool
  • Command buffer commands
    • [x] vkAllocateCommandBuffers
    • [x] vkFreeCommandBuffers
    • [x] vkBeginCommandBuffer
    • [x] vkEndCommandBuffer
    • [x] vkResetCommandBuffer
  • Command buffer building commands
    • [x] vkCmdBindPipeline
    • [ ] vkCmdSetViewport
    • [ ] vkCmdSetScissor
    • [ ] vkCmdSetLineWidth
    • [ ] vkCmdSetDepthBias
    • [ ] vkCmdSetBlendConstants
    • [ ] vkCmdSetDepthBounds
    • [ ] vkCmdSetStencilCompareMask
    • [ ] vkCmdSetStencilWriteMask
    • [ ] vkCmdSetStencilReference
    • [x] vkCmdBindDescriptorSets
    • [x] vkCmdBindIndexBuffer
    • [x] vkCmdBindVertexBuffers
    • [x] vkCmdDraw
    • [x] vkCmdDrawIndexed
    • [x] vkCmdDrawIndirect
    • [x] vkCmdDrawIndexedIndirect
    • [x] vkCmdDispatch
    • [ ] vkCmdDispatchIndirect
    • [x] vkCmdCopyBuffer
    • [x] vkCmdCopyImage
    • [ ] vkCmdBlitImage
    • [ ] vkCmdCopyBufferToImage
    • [ ] vkCmdCopyImageToBuffer
    • [ ] vkCmdUpdateBuffer
    • [ ] vkCmdFillBuffer
    • [ ] vkCmdClearColorImage
    • [ ] vkCmdClearDepthStencilImage
    • [x] vkCmdClearAttachments
    • [ ] vkCmdResolveImage
    • [ ] vkCmdSetEvent
    • [ ] vkCmdResetEvent
    • [ ] vkCmdWaitEvents
    • [x] vkCmdPipelineBarrier
    • [ ] vkCmdBeginQuery
    • [ ] vkCmdEndQuery
    • [ ] vkCmdResetQueryPool
    • [ ] vkCmdWriteTimestamp
    • [ ] vkCmdCopyQueryPoolResults
    • [ ] vkCmdPushConstants
    • [x] vkCmdBeginRenderPass
    • [ ] vkCmdNextSubpass
    • [x] vkCmdEndRenderPass
    • [ ] vkCmdExecuteCommands

FacticiusVir avatar Sep 21 '16 09:09 FacticiusVir

Is this still up to date?

realvictorprm avatar Feb 22 '17 19:02 realvictorprm

For the most part this is up to date; I'm currently working on a port of Sascha Willem's Vulkan samples that will properly test the remaining methods, though the full API is being generated and should work correctly.

FacticiusVir avatar Feb 22 '17 22:02 FacticiusVir

Please bear with me, but what prevents usage of VulkanSharp from Mono?

realvictorprm avatar Feb 22 '17 22:02 realvictorprm

If you're asking why I created these bindings, rather than using the VulkanSharp project - I'm not a fan of VulkanSharp's interop layer which has a lot of opportunities for memory leaks. Additionally, the API as a whole uses a lot of short-lived reference-type objects which causes a lot of memory churn & GC pauses, which is a real problem for apps trying maintain a consistent framerate. On an aesthetic note, SharpVk also arranges the API to be more C#-like, with commands invoked from the specific handle (e.g. CommandBuffer.Draw) instead of the parent Instance or Device.

You might also want to look at https://github.com/discosultan/VulkanCore, which is a hand-crafted binding where ours are auto-generated.

FacticiusVir avatar Feb 22 '17 23:02 FacticiusVir

I would rather say that it's more Object oriented :) Thanks for this information. I would suggest to add this to the read me or somewhere else too because it wasn't clear to me from the readme.

realvictorprm avatar Feb 22 '17 23:02 realvictorprm

You said it's auto generated, why isn't than everything auto generated? If so the list would be checked completely wouldn't it?

realvictorprm avatar Feb 22 '17 23:02 realvictorprm

To clarify - all the methods listed are generated, but they're checked when I have sample code that proves the generation is correct and shows how they're used. You should be able to use any of these methods from your code if you need them.

FacticiusVir avatar Feb 23 '17 00:02 FacticiusVir

Thanks you very much for this information. So we could contribute to this if we help translating the C++ Samples for Vulkan, right? If so I'm going to translate some too.

realvictorprm avatar Feb 23 '17 09:02 realvictorprm

That would be great, thanks! There's a Samples projects here - I'd started porting the C++ base classes in response to https://github.com/FacticiusVir/SharpVk-Samples/issues/2 so the TextOverlay project is the priority, but I'd not had time recently to make much progress so any contribution would be very welcome.

FacticiusVir avatar Feb 23 '17 11:02 FacticiusVir