| 385 | } |
| 386 | |
| 387 | bool Context::ValidateFlags(const Location& loc, vvl::FlagBitmask flag_bitmask, VkFlags all_flags, VkFlags value, |
| 388 | const FlagType flag_type, const char* vuid, const char* flags_zero_vuid, bool instance_function) const { |
| 389 | bool skip = false; |
| 390 | skip |= ValidateFlagsImplementation<VkFlags>(loc, flag_bitmask, all_flags, value, flag_type, vuid, flags_zero_vuid); |
| 391 | |
| 392 | if (ignore_unknown_enums) { |
| 393 | return skip; |
| 394 | } |
| 395 | |
| 396 | if ((value & ~all_flags) != 0) { |
| 397 | skip |= |
| 398 | log.LogError(vuid, error_obj.handle, loc, "contains flag bits (0x%" PRIx32 ") which are not recognized members of %s.", |
| 399 | value, String(flag_bitmask)); |
| 400 | } |
| 401 | |
| 402 | if (!skip && value != 0) { |
| 403 | vvl::Extensions required = IsValidFlagValue(flag_bitmask, value, instance_function); |
| 404 | if (!required.empty()) { |
| 405 | // From https://gitlab.khronos.org/vulkan/vulkan/-/issues/4586 |
| 406 | // Swapchain is only place we have |imageUsage| and it is easy to blindly map it to the supported queried flags |
| 407 | // This is a quick fix, without adding yet another ValidateFlags overload, to give better info around WSI |
| 408 | const bool image_usage_hint = loc.field == Field::imageUsage; |
| 409 | skip |= |
| 410 | log.LogError(vuid, error_obj.handle, loc, "has %s values (%s) that requires the extensions %s.%s", |
| 411 | String(flag_bitmask), DescribeFlagBitmaskValue(flag_bitmask, value).c_str(), String(required).c_str(), |
| 412 | image_usage_hint ? "\nHint: Make sure to filter the supportedUsageFlags from " |
| 413 | "vkGetPhysicalDeviceSurfaceCapabilitiesKHR to only use what is desired." |
| 414 | : ""); |
| 415 | } |
| 416 | } |
| 417 | return skip; |
| 418 | } |
| 419 | |
| 420 | bool Context::ValidateFlags(const Location& loc, vvl::FlagBitmask flag_bitmask, VkFlags64 all_flags, VkFlags64 value, |
| 421 | const FlagType flag_type, const char* vuid, const char* flags_zero_vuid, bool instance_function) const { |
no test coverage detected