gQ = new Queue (dev, Vulkan.VkQueueFlags.Graphics);
VkPhysicalDeviceFeatures features = default;
- dev.Activate (features, new string[] {
+ dev.Activate (IntPtr.Zero, features,
Ext.D.VK_KHR_external_memory,
Ext.D.VK_EXT_external_memory_host,
Ext.D.VK_EXT_external_memory_dma_buf,
- Ext.D.VK_KHR_external_memory_fd,
- });
+ Ext.D.VK_KHR_external_memory_fd
+ );
}
public bool TryGetImageFormatProperties (VkFormat format, VkImageTiling tiling,
VkImageUsageFlags usage, out VkImageFormatProperties properties,
public void listFormat () {
foreach (VkFormat format in Enum.GetValues(typeof(VkFormat))) {
- if (format == VkFormat.G16B16R163plane444UnormKHR)
+ if (format == VkFormat.G16B16R16_3plane444Unorm)
break;
vkGetPhysicalDeviceFormatProperties (phy.Handle, format, out VkFormatProperties props);
foreach (VkExternalMemoryHandleTypeFlags handleType in Enum.GetValues (typeof(VkExternalMemoryHandleTypeFlags))) {
extImgFormatInfo.handleType = handleType;
- VkResult res = vkGetPhysicalDeviceImageFormatProperties2 (phy.Handle, ref imgFormatInfo2, out imgProps2);
+ VkResult res = vkGetPhysicalDeviceImageFormatProperties2 (phy.Handle, ref imgFormatInfo2, ref imgProps2);
if (res == VkResult.Success) {
Console.WriteLine ($"\t{handleType}: f:{extProps.externalMemoryProperties.externalMemoryFeatures} c:{extProps.externalMemoryProperties.compatibleHandleTypes} e:{extProps.externalMemoryProperties.exportFromImportedHandleTypes}");
}
Console.WriteLine($"Mesh Shader Support:\t{meshFeat.Val.meshShader}");
Console.WriteLine($"Task Shader Support:\t{meshFeat.Val.taskShader}");
if (!(meshFeat.Val.meshShader && meshFeat.Val.taskShader)) {
- phy = null;
+ phy = null;
+ return;
}
}
+
+ VkPhysicalDeviceProperties2 phyProp2 = VkPhysicalDeviceProperties2.New;
+ using (var meshP = new PNext<VkPhysicalDeviceMeshShaderPropertiesEXT>()) {
+ phyProp2.pNext = meshP;
+
+ Vk.vkGetPhysicalDeviceProperties2(phy.Handle, ref phyProp2);
+
+ Console.WriteLine($"maxMeshOutputPrimitives:\t{meshP.Val.maxMeshOutputPrimitives}");
+ Console.WriteLine($"prefersLocalInvocationPrimitiveOutput:\t{meshP.Val.prefersLocalInvocationPrimitiveOutput}");
+ Console.WriteLine($"maxMeshOutputVertices:\t{meshP.Val.maxMeshOutputVertices}");
+ Console.WriteLine($"prefersLocalInvocationVertexOutput:\t{meshP.Val.prefersLocalInvocationVertexOutput}");
+ }
}
static void Main (string[] args) {
public IntPtr Handle => inst.Handle;
public VkInstance VkInstance => inst;
- static class Strings {
-
- public static FixedUtf8String main = "main";
- }
const string strValidationLayer = "VK_LAYER_KHRONOS_validation";
const string strRenderDocLayer = "VK_LAYER_RENDERDOC_Capture";
/// </summary>
public class PhysicalDevice {
readonly IntPtr phy;
-
- public VkPhysicalDeviceMemoryProperties memoryProperties { get; private set; }
+ VkPhysicalDeviceMemoryProperties _memoryProperties;
+ public VkPhysicalDeviceMemoryProperties memoryProperties => _memoryProperties;
public VkQueueFamilyProperties [] QueueFamilies { get; private set; }
public VkPhysicalDeviceProperties Properties {
get {
phy = vkPhy;
// Gather physical Device memory properties
- IntPtr tmp = Marshal.AllocHGlobal (Marshal.SizeOf<VkPhysicalDeviceMemoryProperties> ());
- vkGetPhysicalDeviceMemoryProperties (phy, tmp);
-
- memoryProperties = Marshal.PtrToStructure<VkPhysicalDeviceMemoryProperties> (tmp);
- Marshal.FreeHGlobal (tmp);
+ vkGetPhysicalDeviceMemoryProperties (phy, out _memoryProperties);
vkGetPhysicalDeviceQueueFamilyProperties (phy, out uint queueFamilyCount, IntPtr.Zero);
QueueFamilies = new VkQueueFamilyProperties [queueFamilyCount];