SharpVk
SharpVk copied to clipboard
Android, does CreateAndroidSurface work?
I am trying to create an android example app but I keep failing when trying to call CreateAndroidSurface from the Instance:
at
I cant seem to find any SharpVk examples that have a Droid target so I was hoping either, this was a known problem, there are some running examples somewhere I can parse through to find some differences, or maybe I missed a flag somewhere. These are the three extensions I have named:
_Instance = Instance.Create(enabledLayers.ToArray(), new string[] { "VK_KHR_surface", "VK_KHR_android_surface", "VK_EXT_debug_report" }, applicationInfo: applicationInfo);
Thanks much! Brad
EDIT: To add, all the VulkanSharp and VulkanCore samples run...
I've not directly tested the Android extension methods, so it's likely a bug in the bindings; if you have an example app I can test against I'll get it fixed.
I can build a test app tonight for ya. In the meantime I also want to check if I switch out all our code for another Vulkan wrapper and see if that works. If so then maybe it'll help narrow it down.
A little update, I am close to having everything moved over to another wrapper. The big thing though is, the surface creation does work. So I want to spend a little time next week finishing that up but I will put some time into taking their (Xamarin's) sample over to SharpVk so there is atleast a way to use SharpVk on Droid so we can look at it.
To update on this, Windows works but Droid is still broken.
Switching all the code over to VulkanSharp works on all devices. The code crashes here:
Result methodResult = commandDelegate(extendedHandle.handle, marshalledCreateInfo, marshalledAllocator, &marshalledSurface);
under InstanceExtensions.gen.cs.
in the meantime so I can test things out (which works as a temporary solution for droid right now is to change the AndroidSurfaceCreateInfo.gen.cs to: `
/// <summary>
/// The type of this structure.
/// </summary>
public SharpVk.StructureType SType;
/// <summary>
/// Null or an extension-specific structure.
/// </summary>
public IntPtr Next;
/// <summary>
/// Reserved for future use.
/// </summary>
public UInt32 Flags;
/// <summary>
/// A pointer to the ANativeWindow to associate the surface with.
/// </summary>
public IntPtr Window;
`
Did you change the MarshalTo method to match?
Yea I did. Its not a permanent answer, I was hoping it would give you a little more light into the situation.