aboutsummaryrefslogtreecommitdiffstatsci
path: root/vulkan
diff options
context:
space:
mode:
Diffstat (limited to 'vulkan')
-rw-r--r--vulkan/BindingsHelpers.cs36
-rw-r--r--vulkan/Delegates.cs24
-rw-r--r--vulkan/Structs.cs2
-rw-r--r--vulkan/vulkan.csproj7
4 files changed, 18 insertions, 51 deletions
diff --git a/vulkan/BindingsHelpers.cs b/vulkan/BindingsHelpers.cs
deleted file mode 100644
index 60a4ae2..0000000
--- a/vulkan/BindingsHelpers.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2017 Eric Mellino
-// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
-//
-// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace Vulkan {
- public static class BindingsHelpers
- {
- public static unsafe StringHandle StringToHGlobalUtf8(string s)
- {
- Debug.Assert(s != null);
- int byteCount = Encoding.UTF8.GetByteCount(s);
- IntPtr retPtr = Marshal.AllocHGlobal(byteCount);
- fixed (char* stringPtr = s)
- {
- Encoding.UTF8.GetBytes(stringPtr, s.Length, (byte*)retPtr.ToPointer(), byteCount);
- }
-
- return new StringHandle() { Handle = retPtr };
- }
-
- public static void FreeHGlobal(StringHandle ptr)
- {
- Marshal.FreeHGlobal(ptr.Handle);
- }
- }
-
- public struct StringHandle
- {
- public IntPtr Handle;
- }
-}
diff --git a/vulkan/Delegates.cs b/vulkan/Delegates.cs
index f400aca..10a2fb0 100644
--- a/vulkan/Delegates.cs
+++ b/vulkan/Delegates.cs
@@ -6,31 +6,31 @@ using System;
namespace Vulkan
{
- public unsafe delegate void* PFN_vkAllocationFunction(
- void* pUserData,
+ public delegate IntPtr PFN_vkAllocationFunction(
+ IntPtr pUserData,
UIntPtr size,
UIntPtr alignment,
VkSystemAllocationScope allocationScope);
- public unsafe delegate void* PFN_vkReallocationFunction(
- void* pUserData,
- void* pOriginal,
+ public delegate IntPtr PFN_vkReallocationFunction(
+ IntPtr pUserData,
+ IntPtr pOriginal,
UIntPtr size,
UIntPtr alignment,
VkSystemAllocationScope allocationScope);
- public unsafe delegate void PFN_vkFreeFunction(
- void* pUserData,
- void* pMemory);
+ public delegate void PFN_vkFreeFunction(
+ IntPtr pUserData,
+ IntPtr pMemory);
- public unsafe delegate void PFN_vkInternalAllocationNotification(
- void* pUserData,
+ public delegate void PFN_vkInternalAllocationNotification(
+ IntPtr pUserData,
UIntPtr size,
VkInternalAllocationType allocationType,
VkSystemAllocationScope allocationScope);
- public unsafe delegate void PFN_vkInternalFreeNotification(
- void* pUserData,
+ public delegate void PFN_vkInternalFreeNotification(
+ IntPtr pUserData,
UIntPtr size,
VkInternalAllocationType allocationType,
VkSystemAllocationScope allocationScope);
diff --git a/vulkan/Structs.cs b/vulkan/Structs.cs
index 022a679..bb449c1 100644
--- a/vulkan/Structs.cs
+++ b/vulkan/Structs.cs
@@ -265,7 +265,7 @@ namespace Vulkan
descriptorCount = count;
}
}
- public unsafe partial struct VkAttachmentReference
+ public partial struct VkAttachmentReference
{
public VkAttachmentReference(uint attachment, VkImageLayout layout)
{
diff --git a/vulkan/vulkan.csproj b/vulkan/vulkan.csproj
index 0c49024..558eb20 100644
--- a/vulkan/vulkan.csproj
+++ b/vulkan/vulkan.csproj
@@ -19,9 +19,12 @@
<PackageIcon>vk.net-64.png</PackageIcon>
<SynchReleaseVersion>false</SynchReleaseVersion>
<PackageReleaseNotes>
-
+ * Docummentation extracted from Vulkan-Docs
+ * no usafe code.
+ * use Vector type where possible
+ * Proxy structures to handle arrays.
</PackageReleaseNotes>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591;0419</NoWarn>