diff --git a/implementations/Crafter.Graphics-Device.cpp b/implementations/Crafter.Graphics-Device.cpp index 770d50c..b766b9b 100644 --- a/implementations/Crafter.Graphics-Device.cpp +++ b/implementations/Crafter.Graphics-Device.cpp @@ -432,30 +432,24 @@ void Device::Initialize() { app.pEngineName = "Crafter.Graphics"; app.apiVersion = VK_MAKE_VERSION(1, 4, 0); - // TODO(re-enable GPU-AV): once Vulkan SDK > 1.4.341 is the floor. + // GPU-Assisted Validation: shader-execution-time instrumentation that + // catches out-of-bounds descriptor / buffer access the standard layer + // can't see. Opt-in via the enable list below. // - // GPU-Assisted Validation is opt-in via the enable list — leaving it - // out disables it. SDK 1.4.341's GPU-AV does not handle - // descriptor_heap pipelines (VK_PIPELINE_CREATE_2_DESCRIPTOR_HEAP_BIT_EXT - // with layout = VK_NULL_HANDLE): `PipelineSubState::GetPipelineLayoutUnion` - // null-derefs on the first dispatch/draw against such a pipeline. - // - // Tracked + fixed upstream: + // This was previously disabled to work around a bug in SDK 1.4.341's + // GPU-AV, which null-deref'd on descriptor_heap pipelines + // (VK_PIPELINE_CREATE_2_DESCRIPTOR_HEAP_BIT_EXT with layout = + // VK_NULL_HANDLE) in `PipelineSubState::GetPipelineLayoutUnion`: // https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/12103 - // Per spencer-lunarg (LunarG): broken in 1.4.341, fixed and landing - // in the next SDK release. Once we bump our Vulkan-Headers / SDK - // dependency past 1.4.341, restore the original enable list: - // - // VkValidationFeatureEnableEXT enables[] = { - // VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT - // }; - // validationFeatures.enabledValidationFeatureCount = 1; - // validationFeatures.pEnabledValidationFeatures = enables; - // - // Standard validation (the layer itself) is still on; only the GPU-AV - // out-of-bounds / shader-instrumentation checks are temporarily off. + // Per spencer-lunarg (LunarG) that was fixed in the next SDK release. + // The validation layer is now 1.4.350 (> 1.4.341), so re-enable it. + VkValidationFeatureEnableEXT enabledValidationFeatures[] = { + VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT, + }; VkValidationFeaturesEXT validationFeatures = { .sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT, + .enabledValidationFeatureCount = sizeof(enabledValidationFeatures) / sizeof(enabledValidationFeatures[0]), + .pEnabledValidationFeatures = enabledValidationFeatures, }; VkInstanceCreateInfo instanceCreateInfo = {};