layers: Fix parameter_validation array name format

Replace std::string with ParameterName for the parameter_validation
utility functions so that the parameter names printed by these
functions contain the correct array subscript values.

Issues-Addressed: GitHub #462
Change-Id: I09fc6a45e8e41ba28ef7d8fc44ce9e8874feefad
diff --git a/layers/parameter_validation_utils.h b/layers/parameter_validation_utils.h
index dbe8a81..a1d2e1f 100644
--- a/layers/parameter_validation_utils.h
+++ b/layers/parameter_validation_utils.h
@@ -29,6 +29,8 @@
 #include "vk_enum_string_helper.h"
 #include "vk_layer_logging.h"
 
+#include "parameter_name.h"
+
 namespace parameter_validation {
 
 enum ErrorCode {
@@ -112,14 +114,13 @@
 * @return Boolean value indicating that the call should be skipped.
 */
 template <typename T>
-bool ValidateGreaterThan(debug_report_data *report_data, const char *api_name, const char *parameter_name, T value,
-    T lower_bound) {
+bool ValidateGreaterThan(debug_report_data *report_data, const char *api_name, const ParameterName &parameter_name, T value,
+                         T lower_bound) {
     bool skip_call = false;
 
     if (value <= lower_bound) {
-        skip_call |=
-            log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1,
-            LayerName, "%s: parameter %s must be greater than %d", api_name, parameter_name, lower_bound);
+        skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName,
+                             "%s: parameter %s must be greater than %d", api_name, parameter_name.get_name().c_str(), lower_bound);
     }
 
     return skip_call;
@@ -136,13 +137,15 @@
  * @param value Pointer to validate.
  * @return Boolean value indicating that the call should be skipped.
  */
-static bool validate_required_pointer(debug_report_data *report_data, const char *apiName, const char *parameterName,
+static bool validate_required_pointer(debug_report_data *report_data, const char *apiName, const ParameterName &parameterName,
                                       const void *value) {
     bool skip_call = false;
 
     if (value == NULL) {
+
         skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                            REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName, parameterName);
+                             REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName,
+                             parameterName.get_name().c_str());
     }
 
     return skip_call;
@@ -166,20 +169,22 @@
  * @return Boolean value indicating that the call should be skipped.
  */
 template <typename T>
-bool validate_array(debug_report_data *report_data, const char *apiName, const char *countName, const char *arrayName, T count,
-                    const void *array, bool countRequired, bool arrayRequired) {
+bool validate_array(debug_report_data *report_data, const char *apiName, const ParameterName &countName,
+                    const ParameterName &arrayName, T count, const void *array, bool countRequired, bool arrayRequired) {
     bool skip_call = false;
 
     // Count parameters not tagged as optional cannot be 0
     if ((count == 0) && countRequired) {
         skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                            REQUIRED_PARAMETER, LayerName, "%s: parameter %s must be greater than 0", apiName, countName);
+                            REQUIRED_PARAMETER, LayerName, "%s: parameter %s must be greater than 0", apiName,
+                            countName.get_name().c_str());
     }
 
     // Array parameters not tagged as optional cannot be NULL, unless the count is 0
     if ((array == NULL) && arrayRequired && (count != 0)) {
         skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                            REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName, arrayName);
+                            REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName,
+                            arrayName.get_name().c_str());
     }
 
     return skip_call;
@@ -206,14 +211,16 @@
 * @return Boolean value indicating that the call should be skipped.
 */
 template <typename T>
-bool validate_array(debug_report_data *report_data, const char *apiName, const char *countName, const char *arrayName,
-    const T *count, const void *array, bool countPtrRequired, bool countValueRequired, bool arrayRequired) {
+bool validate_array(debug_report_data *report_data, const char *apiName, const ParameterName &countName,
+                    const ParameterName &arrayName, const T *count, const void *array, bool countPtrRequired,
+                    bool countValueRequired, bool arrayRequired) {
     bool skip_call = false;
 
     if (count == NULL) {
         if (countPtrRequired) {
             skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName, countName);
+                                 REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName,
+                                 countName.get_name().c_str());
         }
     }
     else {
@@ -240,20 +247,20 @@
  * @return Boolean value indicating that the call should be skipped.
  */
 template <typename T>
-bool validate_struct_type(debug_report_data *report_data, const char *apiName, const char *parameterName, const char *sTypeName,
-                          const T *value, VkStructureType sType, bool required) {
+bool validate_struct_type(debug_report_data *report_data, const char *apiName, const ParameterName &parameterName,
+                          const char *sTypeName, const T *value, VkStructureType sType, bool required) {
     bool skip_call = false;
 
     if (value == NULL) {
         if (required) {
-            skip_call |=
-                log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                        REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName, parameterName);
+            skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
+                                 REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName,
+                                 parameterName.get_name().c_str());
         }
     } else if (value->sType != sType) {
-        skip_call |=
-            log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                    INVALID_STRUCT_STYPE, LayerName, "%s: parameter %s->sType must be %s", apiName, parameterName, sTypeName);
+        skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
+                             INVALID_STRUCT_STYPE, LayerName, "%s: parameter %s->sType must be %s", apiName,
+                             parameterName.get_name().c_str(), sTypeName);
     }
 
     return skip_call;
@@ -281,19 +288,20 @@
  * @return Boolean value indicating that the call should be skipped.
  */
 template <typename T>
-bool validate_struct_type_array(debug_report_data *report_data, const char *apiName, const char *countName, const char *arrayName,
-                                const char *sTypeName, const uint32_t *count, const T *array, VkStructureType sType,
-                                bool countPtrRequired, bool countValueRequired, bool arrayRequired) {
+bool validate_struct_type_array(debug_report_data *report_data, const char *apiName, const ParameterName &countName,
+                                const ParameterName &arrayName, const char *sTypeName, const uint32_t *count, const T *array,
+                                VkStructureType sType, bool countPtrRequired, bool countValueRequired, bool arrayRequired) {
     bool skip_call = false;
 
     if (count == NULL) {
         if (countPtrRequired) {
             skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                                REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName, countName);
+                                 REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName,
+                                 countName.get_name().c_str());
         }
     } else {
         skip_call |= validate_struct_type_array(report_data, apiName, countName, arrayName, sTypeName, (*count), array, sType,
-                                               countValueRequired, arrayRequired);
+                                                countValueRequired, arrayRequired);
     }
 
     return skip_call;
@@ -319,9 +327,9 @@
  * @return Boolean value indicating that the call should be skipped.
  */
 template <typename T>
-bool validate_struct_type_array(debug_report_data *report_data, const char *apiName, const char *countName, const char *arrayName,
-                                const char *sTypeName, uint32_t count, const T *array, VkStructureType sType, bool countRequired,
-                                bool arrayRequired) {
+bool validate_struct_type_array(debug_report_data *report_data, const char *apiName, const ParameterName &countName,
+                                const ParameterName &arrayName, const char *sTypeName, uint32_t count, const T *array,
+                                VkStructureType sType, bool countRequired, bool arrayRequired) {
     bool skip_call = false;
 
     if ((count == 0) || (array == NULL)) {
@@ -331,8 +339,8 @@
         for (uint32_t i = 0; i < count; ++i) {
             if (array[i].sType != sType) {
                 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
-                                    __LINE__, INVALID_STRUCT_STYPE, LayerName, "%s: parameter %s[%d].sType must be %s", apiName,
-                                    arrayName, i, sTypeName);
+                                     __LINE__, INVALID_STRUCT_STYPE, LayerName, "%s: parameter %s[%d].sType must be %s", apiName,
+                                     arrayName.get_name().c_str(), i, sTypeName);
             }
         }
     }
@@ -352,13 +360,13 @@
 * @return Boolean value indicating that the call should be skipped.
 */
 template <typename T>
-bool validate_required_handle(debug_report_data *report_data, const char *api_name, const char *parameter_name, T value) {
+bool validate_required_handle(debug_report_data *report_data, const char *api_name, const ParameterName &parameter_name, T value) {
     bool skip_call = false;
 
     if (value == VK_NULL_HANDLE) {
         skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
                              REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as VK_NULL_HANDLE", api_name,
-                             parameter_name);
+                             parameter_name.get_name().c_str());
     }
 
     return skip_call;
@@ -387,8 +395,9 @@
 * @return Boolean value indicating that the call should be skipped.
 */
 template <typename T>
-bool validate_handle_array(debug_report_data *report_data, const char *api_name, const char *count_name, const char *array_name,
-                           uint32_t count, const T *array, bool count_required, bool array_required) {
+bool validate_handle_array(debug_report_data *report_data, const char *api_name, const ParameterName &count_name,
+                           const ParameterName &array_name, uint32_t count, const T *array, bool count_required,
+                           bool array_required) {
     bool skip_call = false;
 
     if ((count == 0) || (array == NULL)) {
@@ -397,9 +406,10 @@
         // Verify that no handles in the array are VK_NULL_HANDLE
         for (uint32_t i = 0; i < count; ++i) {
             if (array[i] == VK_NULL_HANDLE) {
-                skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
-                                     __LINE__, REQUIRED_PARAMETER, LayerName,
-                                     "%s: required parameter %s[%d] specified as VK_NULL_HANDLE", api_name, array_name, i);
+                skip_call |=
+                    log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
+                            REQUIRED_PARAMETER, LayerName, "%s: required parameter %s[%d] specified as VK_NULL_HANDLE", api_name,
+                            array_name.get_name().c_str(), i);
             }
         }
     }
@@ -425,8 +435,9 @@
  * @param arrayRequired The 'array' parameter may not be NULL when true.
  * @return Boolean value indicating that the call should be skipped.
  */
-static bool validate_string_array(debug_report_data *report_data, const char *apiName, const char *countName, const char *arrayName,
-                                  uint32_t count, const char *const *array, bool countRequired, bool arrayRequired) {
+static bool validate_string_array(debug_report_data *report_data, const char *apiName, const ParameterName &countName,
+                                  const ParameterName &arrayName, uint32_t count, const char *const *array, bool countRequired,
+                                  bool arrayRequired) {
     bool skip_call = false;
 
     if ((count == 0) || (array == NULL)) {
@@ -436,8 +447,8 @@
         for (uint32_t i = 0; i < count; ++i) {
             if (array[i] == NULL) {
                 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
-                                    __LINE__, REQUIRED_PARAMETER, LayerName, "%s: required parameter %s[%d] specified as NULL",
-                                    apiName, arrayName, i);
+                                     __LINE__, REQUIRED_PARAMETER, LayerName, "%s: required parameter %s[%d] specified as NULL",
+                                     apiName, arrayName.get_name().c_str(), i);
             }
         }
     }
@@ -462,7 +473,7 @@
  * @param header_version Version of header defining the pNext validation rules.
  * @return Boolean value indicating that the call should be skipped.
  */
-static bool validate_struct_pnext(debug_report_data *report_data, const char *api_name, const char *parameter_name,
+static bool validate_struct_pnext(debug_report_data *report_data, const char *api_name, const ParameterName &parameter_name,
                                   const char *allowed_struct_names, const void *next, size_t allowed_type_count,
                                   const VkStructureType *allowed_types, uint32_t header_version) {
     bool skip_call = false;
@@ -475,9 +486,9 @@
         if (allowed_type_count == 0) {
             std::string message = "%s: value of %s must be NULL.  ";
             message += disclaimer;
-            skip_call |=
-                log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                        INVALID_STRUCT_PNEXT, LayerName, message.c_str(), api_name, parameter_name, header_version, parameter_name);
+            skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
+                                 INVALID_STRUCT_PNEXT, LayerName, message.c_str(), api_name, parameter_name.get_name().c_str(),
+                                 header_version, parameter_name.get_name().c_str());
         } else {
             const VkStructureType *start = allowed_types;
             const VkStructureType *end = allowed_types + allowed_type_count;
@@ -493,15 +504,16 @@
                         message += disclaimer;
                         skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
                                              0, __LINE__, INVALID_STRUCT_PNEXT, LayerName, message.c_str(), api_name,
-                                             parameter_name, current->sType, allowed_struct_names, header_version, parameter_name);
+                                             parameter_name.get_name().c_str(), current->sType, allowed_struct_names,
+                                             header_version, parameter_name.get_name().c_str());
                     } else {
                         std::string message =
                             "%s: %s chain includes a structure with unexpected VkStructureType %s; Allowed structures are [%s].  ";
                         message += disclaimer;
-                        skip_call |=
-                            log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
-                                    __LINE__, INVALID_STRUCT_PNEXT, LayerName, message.c_str(), api_name, parameter_name,
-                                    type_name.c_str(), allowed_struct_names, header_version, parameter_name);
+                        skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
+                                             0, __LINE__, INVALID_STRUCT_PNEXT, LayerName, message.c_str(), api_name,
+                                             parameter_name.get_name().c_str(), type_name.c_str(), allowed_struct_names,
+                                             header_version, parameter_name.get_name().c_str());
                     }
                 }
 
@@ -524,13 +536,14 @@
 * @param value Boolean value to validate.
 * @return Boolean value indicating that the call should be skipped.
 */
-static bool validate_bool32(debug_report_data *report_data, const char *apiName, const char *parameterName, VkBool32 value) {
+static bool validate_bool32(debug_report_data *report_data, const char *apiName, const ParameterName &parameterName,
+                            VkBool32 value) {
     bool skip_call = false;
 
     if ((value != VK_TRUE) && (value != VK_FALSE)) {
         skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                            UNRECOGNIZED_VALUE, LayerName, "%s: value of %s (%d) is neither VK_TRUE nor VK_FALSE", apiName,
-                            parameterName, value);
+                             UNRECOGNIZED_VALUE, LayerName, "%s: value of %s (%d) is neither VK_TRUE nor VK_FALSE", apiName,
+                             parameterName.get_name().c_str(), value);
     }
 
     return skip_call;
@@ -556,8 +569,8 @@
 * @return Boolean value indicating that the call should be skipped.
 */
 template <typename T>
-bool validate_ranged_enum(debug_report_data *report_data, const char *apiName, const char *parameterName, const char *enumName,
-                          T begin, T end, T value) {
+bool validate_ranged_enum(debug_report_data *report_data, const char *apiName, const ParameterName &parameterName,
+                          const char *enumName, T begin, T end, T value) {
     bool skip_call = false;
 
     if (((value < begin) || (value > end)) && !is_extension_added_token(value)) {
@@ -565,7 +578,7 @@
             log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
                     UNRECOGNIZED_VALUE, LayerName, "%s: value of %s (%d) does not fall within the begin..end range of the core %s "
                                                    "enumeration tokens and is not an extension added token",
-                    apiName, parameterName, value, enumName);
+                    apiName, parameterName.get_name().c_str(), value, enumName);
     }
 
     return skip_call;
@@ -595,9 +608,9 @@
 * @return Boolean value indicating that the call should be skipped.
 */
 template <typename T>
-static bool validate_ranged_enum_array(debug_report_data *report_data, const char *apiName, const char *countName,
-                                       const char *arrayName, const char *enumName, T begin, T end, uint32_t count, const T *array,
-                                       bool countRequired, bool arrayRequired) {
+static bool validate_ranged_enum_array(debug_report_data *report_data, const char *apiName, const ParameterName &countName,
+                                       const ParameterName &arrayName, const char *enumName, T begin, T end, uint32_t count,
+                                       const T *array, bool countRequired, bool arrayRequired) {
     bool skip_call = false;
 
     if ((count == 0) || (array == NULL)) {
@@ -606,10 +619,10 @@
         for (uint32_t i = 0; i < count; ++i) {
             if (((array[i] < begin) || (array[i] > end)) && !is_extension_added_token(array[i])) {
                 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
-                                    __LINE__, UNRECOGNIZED_VALUE, LayerName,
-                                    "%s: value of %s[%d] (%d) does not fall within the begin..end range of the core %s "
-                                    "enumeration tokens and is not an extension added token",
-                                    apiName, arrayName, i, array[i], enumName);
+                                     __LINE__, UNRECOGNIZED_VALUE, LayerName,
+                                     "%s: value of %s[%d] (%d) does not fall within the begin..end range of the core %s "
+                                     "enumeration tokens and is not an extension added token",
+                                     apiName, arrayName.get_name().c_str(), i, array[i], enumName);
             }
         }
     }
@@ -629,13 +642,14 @@
 * @param value Value to validate.
 * @return Boolean value indicating that the call should be skipped.
 */
-static bool validate_reserved_flags(debug_report_data *report_data, const char *api_name, const char *parameter_name,
+static bool validate_reserved_flags(debug_report_data *report_data, const char *api_name, const ParameterName &parameter_name,
                                     VkFlags value) {
     bool skip_call = false;
 
     if (value != 0) {
-        skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                             RESERVED_PARAMETER, LayerName, "%s: parameter %s must be 0", api_name, parameter_name);
+        skip_call |=
+            log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
+                    RESERVED_PARAMETER, LayerName, "%s: parameter %s must be 0", api_name, parameter_name.get_name().c_str());
     }
 
     return skip_call;
@@ -656,20 +670,21 @@
 * @param flags_required The 'value' parameter may not be 0 when true.
 * @return Boolean value indicating that the call should be skipped.
 */
-static bool validate_flags(debug_report_data *report_data, const char *api_name, const char *parameter_name,
+static bool validate_flags(debug_report_data *report_data, const char *api_name, const ParameterName &parameter_name,
                            const char *flag_bits_name, VkFlags all_flags, VkFlags value, bool flags_required) {
     bool skip_call = false;
 
     if (value == 0) {
         if (flags_required) {
             skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                                 REQUIRED_PARAMETER, LayerName, "%s: value of %s must not be 0", api_name, parameter_name);
+                                 REQUIRED_PARAMETER, LayerName, "%s: value of %s must not be 0", api_name,
+                                 parameter_name.get_name().c_str());
         }
     } else if ((value & (~all_flags)) != 0) {
         skip_call |=
             log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
                     UNRECOGNIZED_VALUE, LayerName, "%s: value of %s contains flag bits that are not recognized members of %s",
-                    api_name, parameter_name, flag_bits_name);
+                    api_name, parameter_name.get_name().c_str(), flag_bits_name);
     }
 
     return skip_call;
@@ -693,8 +708,8 @@
 * @param array_required The 'array' parameter may not be NULL when true.
 * @return Boolean value indicating that the call should be skipped.
 */
-static bool validate_flags_array(debug_report_data *report_data, const char *api_name, const char *count_name,
-                                 const char *array_name, const char *flag_bits_name, VkFlags all_flags, uint32_t count,
+static bool validate_flags_array(debug_report_data *report_data, const char *api_name, const ParameterName &count_name,
+                                 const ParameterName &array_name, const char *flag_bits_name, VkFlags all_flags, uint32_t count,
                                  const VkFlags *array, bool count_required, bool array_required) {
     bool skip_call = false;
 
@@ -707,15 +722,15 @@
                 // Current XML registry logic for validity generation uses the array parameter's optional tag to determine if
                 // elements in the array are allowed be 0
                 if (array_required) {
-                    skip_call |=
-                        log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
-                                REQUIRED_PARAMETER, LayerName, "%s: value of %s[%d] must not be 0", api_name, array_name, i);
+                    skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+                                         __LINE__, REQUIRED_PARAMETER, LayerName, "%s: value of %s[%d] must not be 0", api_name,
+                                         array_name.get_name().c_str(), i);
                 }
             } else if ((array[i] & (~all_flags)) != 0) {
                 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
                                      __LINE__, UNRECOGNIZED_VALUE, LayerName,
                                      "%s: value of %s[%d] contains flag bits that are not recognized members of %s", api_name,
-                                     array_name, i, flag_bits_name);
+                                     array_name.get_name().c_str(), i, flag_bits_name);
             }
         }
     }