Lines Matching +full:vulkan +full:- +full:layers
4 * Use of this source code is governed by a BSD-style license that can be
14 #define SK_GPU_TOOLS_VK_LIBRARY_NAME "vulkan-1.dll"
60 // Helper code to set up Vulkan context objects
76 // Returns the index into layers array for the layer we want. Returns -1 if not supported.
78 uint32_t layerCount, VkLayerProperties* layers, in should_include_debug_layer() argument
81 if (!strcmp(layerName, layers[i].layerName)) { in should_include_debug_layer()
82 // Since the layers intercept the vulkan calls and forward them on, we need to make sure in should_include_debug_layer()
83 // layer was written against a version that isn't older than the version of Vulkan we're in should_include_debug_layer()
85 if (version <= remove_patch_version(layers[i].specVersion)) { in should_include_debug_layer()
88 return -1; in should_include_debug_layer()
92 return -1; in should_include_debug_layer()
115 // See https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/1887 in DebugReportCallback()
116 if (strstr(pMessage, "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01521") || in DebugReportCallback()
117 strstr(pMessage, "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01522")) { in DebugReportCallback()
120 // See https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/2171 in DebugReportCallback()
121 if (strstr(pMessage, "VUID-vkCmdDraw-None-02686") || in DebugReportCallback()
122 strstr(pMessage, "VUID-vkCmdDrawIndexed-None-02686")) { in DebugReportCallback()
125 SkDebugf("Vulkan error [%s]: code: %d: %s\n", pLayerPrefix, messageCode, pMessage); in DebugReportCallback()
127 SkDEBUGFAIL("Vulkan debug layer error"); in DebugReportCallback()
128 return VK_TRUE; // skip further layers in DebugReportCallback()
130 SkDebugf("Vulkan warning [%s]: code: %d: %s\n", pLayerPrefix, messageCode, pMessage); in DebugReportCallback()
133 SkDebugf("Vulkan perf warning [%s]: code: %d: %s\n", pLayerPrefix, messageCode, pMessage); in DebugReportCallback()
136 SkDebugf("Vulkan info/debug [%s]: code: %d: %s\n", pLayerPrefix, messageCode, pMessage); in DebugReportCallback()
163 // instance layers in init_instance_extensions_and_layers()
168 VkLayerProperties* layers = new VkLayerProperties[layerCount]; in init_instance_extensions_and_layers() local
169 res = EnumerateInstanceLayerProperties(&layerCount, layers); in init_instance_extensions_and_layers()
171 delete[] layers; in init_instance_extensions_and_layers()
177 int idx = should_include_debug_layer(kDebugLayerNames[i], layerCount, layers, in init_instance_extensions_and_layers()
179 if (idx != -1) { in init_instance_extensions_and_layers()
180 instanceLayers->push_back() = layers[idx]; in init_instance_extensions_and_layers()
183 delete[] layers; in init_instance_extensions_and_layers()
187 // via Vulkan implementation and implicitly enabled layers in init_instance_extensions_and_layers()
201 instanceExtensions->push_back() = extensions[i]; in init_instance_extensions_and_layers()
206 // via explicitly enabled layers in init_instance_extensions_and_layers()
207 layerCount = instanceLayers->count(); in init_instance_extensions_and_layers()
223 instanceExtensions->push_back() = extensions[i]; in init_instance_extensions_and_layers()
248 // device layers in init_device_extensions_and_layers()
255 VkLayerProperties* layers = new VkLayerProperties[layerCount]; in init_device_extensions_and_layers() local
256 res = EnumerateDeviceLayerProperties(physDev, &layerCount, layers); in init_device_extensions_and_layers()
258 delete[] layers; in init_device_extensions_and_layers()
264 int idx = should_include_debug_layer(kDebugLayerNames[i], layerCount, layers, in init_device_extensions_and_layers()
266 if (idx != -1) { in init_device_extensions_and_layers()
267 deviceLayers->push_back() = layers[idx]; in init_device_extensions_and_layers()
270 delete[] layers; in init_device_extensions_and_layers()
274 // via Vulkan implementation and implicitly enabled layers in init_device_extensions_and_layers()
288 deviceExtensions->push_back() = extensions[i]; in init_device_extensions_and_layers()
293 // via explicitly enabled layers in init_device_extensions_and_layers()
294 layerCount = deviceLayers->count(); in init_device_extensions_and_layers()
312 deviceExtensions->push_back() = extensions[i]; in init_device_extensions_and_layers()
363 extensions->hasExtension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, 1)); in setup_features()
366 void** tailPNext = &features->pNext; in setup_features()
375 protectedMemoryFeatures->sType = in setup_features()
377 protectedMemoryFeatures->pNext = nullptr; in setup_features()
379 tailPNext = &protectedMemoryFeatures->pNext; in setup_features()
383 if (extensions->hasExtension(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, 2)) { in setup_features()
386 blend->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; in setup_features()
387 blend->pNext = nullptr; in setup_features()
389 tailPNext = &blend->pNext; in setup_features()
394 extensions->hasExtension(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, 1)) { in setup_features()
397 ycbcrFeature->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; in setup_features()
398 ycbcrFeature->pNext = nullptr; in setup_features()
399 ycbcrFeature->samplerYcbcrConversion = VK_TRUE; in setup_features()
401 tailPNext = &ycbcrFeature->pNext; in setup_features()
408 SkASSERT(extensions->hasExtension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, in setup_features()
415 if (!protectedMemoryFeatures->protectedMemory) { in setup_features()
455 // since that is the highest vulkan version. in CreateVkBackendContext()
661 // Don't use experimental extensions since they typically don't work with debug layers and in CreateVkBackendContext()
667 // This is an nvidia extension that isn't supported by the debug layers so we get lots in CreateVkBackendContext()
683 extensions->init(getProc, inst, physDev, in CreateVkBackendContext()
690 features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; in CreateVkBackendContext()
691 features->pNext = nullptr; in CreateVkBackendContext()
693 VkPhysicalDeviceFeatures* deviceFeatures = &features->features; in CreateVkBackendContext()
696 extensions->hasExtension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, 1)) { in CreateVkBackendContext()
712 deviceFeatures->robustBufferAccess = VK_FALSE; in CreateVkBackendContext()
781 ctx->fInstance = inst; in CreateVkBackendContext()
782 ctx->fPhysicalDevice = physDev; in CreateVkBackendContext()
783 ctx->fDevice = device; in CreateVkBackendContext()
784 ctx->fQueue = queue; in CreateVkBackendContext()
785 ctx->fGraphicsQueueIndex = graphicsQueueIndex; in CreateVkBackendContext()
786 ctx->fMaxAPIVersion = apiVersion; in CreateVkBackendContext()
787 ctx->fVkExtensions = extensions; in CreateVkBackendContext()
788 ctx->fDeviceFeatures2 = features; in CreateVkBackendContext()
789 ctx->fGetProc = getProc; in CreateVkBackendContext()
790 ctx->fOwnsInstanceAndDevice = false; in CreateVkBackendContext()
791 ctx->fProtectedContext = isProtected ? GrProtected::kYes : GrProtected::kNo; in CreateVkBackendContext()
797 // All Vulkan structs that could be part of the features chain will start with the in FreeVulkanFeaturesStructs()
805 void* pNext = features->pNext; in FreeVulkanFeaturesStructs()
808 pNext = static_cast<CommonVulkanHeader*>(current)->pNext; in FreeVulkanFeaturesStructs()