Class VKHelpers
Set of Vulkan helpers.
Inherited Members
Namespace: Evergine.Vulkan
Assembly: Evergine.Vulkan.dll
Syntax
public static class VKHelpers
  Methods
CheckErrors(GraphicsContext, VkResult)
Check 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 last operation.  | 
      
EnumerateInstanceExtensions(GraphicsContext)
Returns up to 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 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[] | The string array of supported layers.  | 
      
FindMemoryType(VKGraphicsContext, uint, VkMemoryPropertyFlags)
Find 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 filter type.  | 
      
| VkMemoryPropertyFlags | properties | The memory properties.  | 
      
Returns
| Type | Description | 
|---|---|
| int | A value > 0 if everything was ok.  | 
      
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 slop 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 memory properties.  | 
      
| uint | index | The memory index.  | 
      
Returns
| Type | Description | 
|---|---|
| VkMemoryType | The result memory type.  | 
      
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)
Convert a Matrix4x4 in 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)
Create a valide Api version uint.
Declaration
public static uint Version(uint major, uint minor, uint patch)
  Parameters
| Type | Name | Description | 
|---|---|---|
| uint | major | The major.  | 
      
| uint | minor | The minor.  | 
      
| uint | patch | The patch.  | 
      
Returns
| Type | Description | 
|---|---|
| uint | Vulkan api version.  |