Class VKHelpers
A set of Vulkan helpers.
Namespace: Evergine.Vulkan
Assembly: Evergine.Vulkan.dll
Syntax
public static class VKHelpers
Methods
CheckErrors(GraphicsContext, VkResult)
Checks for errors.
Declaration
[Conditional("DEBUG")]
public static void CheckErrors(GraphicsContext context, VkResult result)
Parameters
Type | Name | Description |
---|---|---|
GraphicsContext | context | The graphics context. |
VkResult | result | The result of the last operation. |
EnumerateInstanceExtensions(GraphicsContext)
Returns up to the requested number of global extension properties.
Declaration
public static string[] EnumerateInstanceExtensions(GraphicsContext context)
Parameters
Type | Name | Description |
---|---|---|
GraphicsContext | context | The graphics context. |
Returns
Type | Description |
---|---|
string[] | A string array of supported extensions. |
EnumerateInstanceLayers(GraphicsContext)
Returns up to the requested number of global layer properties.
Declaration
public static string[] EnumerateInstanceLayers(GraphicsContext context)
Parameters
Type | Name | Description |
---|---|---|
GraphicsContext | context | The graphics context. |
Returns
Type | Description |
---|---|
string[] | A string array of supported layers. |
FindMemoryType(VKGraphicsContext, uint, VkMemoryPropertyFlags)
Finds a memory type.
Declaration
public static int FindMemoryType(VKGraphicsContext context, uint typeFilter, VkMemoryPropertyFlags properties)
Parameters
Type | Name | Description |
---|---|---|
VKGraphicsContext | context | The graphics context. |
uint | typeFilter | The type filter. |
VkMemoryPropertyFlags | properties | The memory properties. |
Returns
Type | Description |
---|---|
int | A value greater than 0 if successful. |
GetBinding(LayoutElementDescription)
Gets the bindings offset to avoid overlap.
Declaration
public static uint GetBinding(LayoutElementDescription element)
Parameters
Type | Name | Description |
---|---|---|
LayoutElementDescription | element | The layout element description. |
Returns
Type | Description |
---|---|
uint | The first slot available. |
GetMemoryType(VkPhysicalDeviceMemoryProperties, uint)
Gets the memory type.
Declaration
public static VkMemoryType GetMemoryType(this VkPhysicalDeviceMemoryProperties memoryProperties, uint index)
Parameters
Type | Name | Description |
---|---|---|
VkPhysicalDeviceMemoryProperties | memoryProperties | The device's memory properties. |
uint | index | The memory index. |
Returns
Type | Description |
---|---|
VkMemoryType | The resulting memory type. |
GetString(byte*)
Get a string from a char* pointer.
Declaration
public static string GetString(byte* stringStart)
Parameters
Type | Name | Description |
---|---|---|
byte* | stringStart | The char* pointer. |
Returns
Type | Description |
---|---|
string | The result as UTF8 string. |
ToPointer(string)
Helper to convert a string to a byte* pointer.
Declaration
public static byte* ToPointer(this string text)
Parameters
Type | Name | Description |
---|---|---|
string | text | The string. |
Returns
Type | Description |
---|---|
byte* | The byte* pointer in unmanaged memory. |
ToTransformMatrix(Matrix4x4)
Converts a Matrix4x4 into a Vulkan transform matrix 3x4.
Declaration
public static VkTransformMatrixKHR ToTransformMatrix(this Matrix4x4 m)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | m | The matrix to convert. |
Returns
Type | Description |
---|---|
VkTransformMatrixKHR | The Vulkan transform matrix. |
Version(uint, uint, uint)
Creates a valid API version uint.
Declaration
public static uint Version(uint major, uint minor, uint patch)
Parameters
Type | Name | Description |
---|---|---|
uint | major | The major version. |
uint | minor | The minor version. |
uint | patch | The patch version. |
Returns
Type | Description |
---|---|
uint | Vulkan API version. |