From 15f254bbabb74e3fc22ef199354b0ce3c9919a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Thu, 17 Sep 2026 10:18:37 +0900 Subject: [PATCH] Remove non-functional device layers It is an error to use device layers; they've been non-functional for a very long time already. Instance layers should be (and already are) used instead. See also: Validation Error: [ VUID-VkDeviceCreateInfo-ppEnabledLayerNames-12385 ] | MessageID = 0xd19e260d vkCreateDevice(): pCreateInfo->ppEnabledLayerNames is 0x7ffd73690468 (not null). Device Layers have never worked since Vulkan 1.0 and only Instance Layers should be used instead: https://docs.vulkan.org/spec/latest/appendices/legacy.html#legacy-devicelayers. The Vulkan spec states: ppEnabledLayerNames must be NULL (https://docs.vulkan.org/spec/latest/chapters/devsandqueues.html#VUID-VkDeviceCreateInfo-ppEnabledLayerNames-12385) Objects: 1 [0] VkPhysicalDevice 0x62a622b77150 --- src/Veldrid/Vk/VkGraphicsDevice.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/Veldrid/Vk/VkGraphicsDevice.cs b/src/Veldrid/Vk/VkGraphicsDevice.cs index d3bb85528..31b26b29b 100644 --- a/src/Veldrid/Vk/VkGraphicsDevice.cs +++ b/src/Veldrid/Vk/VkGraphicsDevice.cs @@ -118,8 +118,6 @@ private readonly Dictionary submittedSharedC private bool debugMarkerEnabled; private VkDebugMarkerSetObjectNameExtT setObjectNameDelegate; private readonly Stack sharedGraphicsCommandPools = new Stack(); - private bool standardValidationSupported; - private bool khronosValidationSupported; private bool standardClipYDirection; private VkGetPhysicalDeviceProperties2T getPhysicalDeviceProperties2; @@ -840,16 +838,10 @@ private void createInstance(bool debug, VulkanDeviceOptions options) } if (availableInstanceLayers.Contains(CommonStrings.StandardValidationLayerName)) - { - standardValidationSupported = true; instanceLayers.Add(CommonStrings.StandardValidationLayerName); - } if (availableInstanceLayers.Contains(CommonStrings.KhronosValidationLayerName)) - { - khronosValidationSupported = true; instanceLayers.Add(CommonStrings.KhronosValidationLayerName); - } } instanceCi.enabledExtensionCount = instanceExtensions.Count; @@ -1018,13 +1010,6 @@ private void createLogicalDevice(VkSurfaceKHR surface, bool preferStandardClipY, deviceCreateInfo.pEnabledFeatures = &deviceFeatures; - var layerNames = new StackList(); - if (standardValidationSupported) layerNames.Add(CommonStrings.StandardValidationLayerName); - - if (khronosValidationSupported) layerNames.Add(CommonStrings.KhronosValidationLayerName); - deviceCreateInfo.enabledLayerCount = layerNames.Count; - deviceCreateInfo.ppEnabledLayerNames = (byte**)layerNames.Data; - fixed (IntPtr* activeExtensionsPtr = activeExtensions) { deviceCreateInfo.enabledExtensionCount = activeExtensionCount;