FacticiusVir / SharpVk

C# Bindings for the Vulkan API & SPIR-V
MIT License
147 stars 18 forks source link

VK API Commands should be correctly generated, compiled & executed #22

Open FacticiusVir opened 7 years ago

FacticiusVir commented 7 years ago

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

realvictorprm commented 7 years ago

Is this still up to date?

FacticiusVir commented 7 years ago

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.

realvictorprm commented 7 years ago

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

FacticiusVir commented 7 years ago

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.

realvictorprm commented 7 years ago

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 commented 7 years ago

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

FacticiusVir commented 7 years ago

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.

realvictorprm commented 7 years ago

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.

FacticiusVir commented 7 years ago

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.