feat(vulkan): re-enable GPU-Assisted Validation #19

Merged
catbot merged 1 commit from claude/issue-17 into master 2026-06-03 04:11:00 +02:00

View file

@ -432,30 +432,24 @@ void Device::Initialize() {
app.pEngineName = "Crafter.Graphics"; app.pEngineName = "Crafter.Graphics";
app.apiVersion = VK_MAKE_VERSION(1, 4, 0); 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 // This was previously disabled to work around a bug in SDK 1.4.341's
// out disables it. SDK 1.4.341's GPU-AV does not handle // GPU-AV, which null-deref'd on descriptor_heap pipelines
// descriptor_heap pipelines (VK_PIPELINE_CREATE_2_DESCRIPTOR_HEAP_BIT_EXT // (VK_PIPELINE_CREATE_2_DESCRIPTOR_HEAP_BIT_EXT with layout =
// with layout = VK_NULL_HANDLE): `PipelineSubState::GetPipelineLayoutUnion` // VK_NULL_HANDLE) in `PipelineSubState::GetPipelineLayoutUnion`:
// null-derefs on the first dispatch/draw against such a pipeline.
//
// Tracked + fixed upstream:
// https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/12103 // https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/12103
// Per spencer-lunarg (LunarG): broken in 1.4.341, fixed and landing // Per spencer-lunarg (LunarG) that was fixed in the next SDK release.
// in the next SDK release. Once we bump our Vulkan-Headers / SDK // The validation layer is now 1.4.350 (> 1.4.341), so re-enable it.
// dependency past 1.4.341, restore the original enable list: VkValidationFeatureEnableEXT enabledValidationFeatures[] = {
// VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT,
// 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.
VkValidationFeaturesEXT validationFeatures = { VkValidationFeaturesEXT validationFeatures = {
.sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT, .sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT,
.enabledValidationFeatureCount = sizeof(enabledValidationFeatures) / sizeof(enabledValidationFeatures[0]),
.pEnabledValidationFeatures = enabledValidationFeatures,
}; };
VkInstanceCreateInfo instanceCreateInfo = {}; VkInstanceCreateInfo instanceCreateInfo = {};