aboutsummaryrefslogtreecommitdiff
path: root/layers/parameter_validation_utils.h
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2017-01-19 21:10:49 -0700
committerLenny Komow <lenny@lunarg.com>2017-01-24 14:07:22 -0700
commit82ea0b0103880d011ca679b14f0fc5542c5b2012 (patch)
tree11be85261197447e58e046affecbd43c36b4a8d8 /layers/parameter_validation_utils.h
parent8fc3d170de6515c0d26fb6b17bd3b5e27711e607 (diff)
downloadusermoji-82ea0b0103880d011ca679b14f0fc5542c5b2012.tar.xz
loader: Update the loader to 1.0.39
Add new extensions for 1.0.39. Also, updated layers to include minimal set of functionality for 1.0.39 extensions. Extensions include: - VK_KHR_get_physical_device_properties2 - VK_KHR_shader_draw_parameters - VK_EXT_direct_mode_display - VK_EXT_display_surface_counter - VK_EXT_display_control Also, redo the LoaderAndLayerIf document. Change-Id: I10412086da7a798afe832a3892e18f606259b5af
Diffstat (limited to 'layers/parameter_validation_utils.h')
-rw-r--r--layers/parameter_validation_utils.h73
1 files changed, 39 insertions, 34 deletions
diff --git a/layers/parameter_validation_utils.h b/layers/parameter_validation_utils.h
index 4e4fd812..7c6e605f 100644
--- a/layers/parameter_validation_utils.h
+++ b/layers/parameter_validation_utils.h
@@ -81,6 +81,11 @@ struct instance_extension_enables {
bool android_enabled;
bool win32_enabled;
bool display_enabled;
+ bool khr_get_phys_dev_properties2_enabled;
+ bool ext_acquire_xlib_display_enabled;
+ bool ext_direct_mode_display_enabled;
+ bool ext_display_surface_counter_enabled;
+ bool nv_external_memory_capabilities_enabled;
};
// String returned by string_VkStructureType for an unrecognized type.
@@ -272,11 +277,10 @@ bool validate_struct_type(debug_report_data *report_data, const char *apiName, c
}
/**
- * Validate an array of Vulkan structures.
+ * Validate an array of Vulkan structures
*
- * Verify that required count and array parameters are not NULL. If count
- * is not NULL and its value is not optional, verify that it is not 0.
- * If the array contains 1 or more structures, verify that each structure's
+ * Verify that required count and array parameters are not 0 or NULL. If
+ * the array contains 1 or more structures, verify that each structure's
* sType field is set to the correct VkStructureType value.
*
* @param report_data debug_report_data object for routing validation messages.
@@ -284,39 +288,41 @@ bool validate_struct_type(debug_report_data *report_data, const char *apiName, c
* @param countName Name of count parameter.
* @param arrayName Name of array parameter.
* @param sTypeName Name of expected VkStructureType value.
- * @param count Pointer to the number of elements in the array.
+ * @param count Number of elements in the array.
* @param array Array to validate.
* @param sType VkStructureType for structure validation.
- * @param countPtrRequired The 'count' parameter may not be NULL when true.
- * @param countValueRequired The '*count' value may not be 0 when true.
+ * @param countRequired The 'count' parameter may not be 0 when true.
* @param arrayRequired The 'array' parameter may not be NULL when true.
* @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 ParameterName &countName,
- const ParameterName &arrayName, const char *sTypeName, const uint32_t *count, const T *array,
- VkStructureType sType, bool countPtrRequired, bool countValueRequired, bool arrayRequired) {
+ const ParameterName &arrayName, const char *sTypeName, uint32_t count, const T *array,
+ VkStructureType sType, bool countRequired, 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.get_name().c_str());
- }
+ if ((count == 0) || (array == NULL)) {
+ skip_call |= validate_array(report_data, apiName, countName, arrayName, count, array, countRequired, arrayRequired);
} else {
- skip_call |= validate_struct_type_array(report_data, apiName, countName, arrayName, sTypeName, (*count), array, sType,
- countValueRequired, arrayRequired);
+ // Verify that all structs in the array have the correct type
+ 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.get_name().c_str(), i, sTypeName);
+ }
+ }
}
return skip_call;
}
/**
- * Validate an array of Vulkan structures
+ * Validate an array of Vulkan structures.
*
- * Verify that required count and array parameters are not 0 or NULL. If
- * the array contains 1 or more structures, verify that each structure's
+ * Verify that required count and array parameters are not NULL. If count
+ * is not NULL and its value is not optional, verify that it is not 0.
+ * If the array contains 1 or more structures, verify that each structure's
* sType field is set to the correct VkStructureType value.
*
* @param report_data debug_report_data object for routing validation messages.
@@ -324,30 +330,29 @@ bool validate_struct_type_array(debug_report_data *report_data, const char *apiN
* @param countName Name of count parameter.
* @param arrayName Name of array parameter.
* @param sTypeName Name of expected VkStructureType value.
- * @param count Number of elements in the array.
+ * @param count Pointer to the number of elements in the array.
* @param array Array to validate.
* @param sType VkStructureType for structure validation.
- * @param countRequired The 'count' parameter may not be 0 when true.
+ * @param countPtrRequired The 'count' parameter may not be NULL when true.
+ * @param countValueRequired The '*count' value may not be 0 when true.
* @param arrayRequired The 'array' parameter may not be NULL when true.
* @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 ParameterName &countName,
- const ParameterName &arrayName, const char *sTypeName, uint32_t count, const T *array,
- VkStructureType sType, bool countRequired, bool arrayRequired) {
+ const ParameterName &arrayName, const char *sTypeName, uint32_t *count, const T *array,
+ VkStructureType sType, bool countPtrRequired, bool countValueRequired, bool arrayRequired) {
bool skip_call = false;
- if ((count == 0) || (array == NULL)) {
- skip_call |= validate_array(report_data, apiName, countName, arrayName, count, array, countRequired, arrayRequired);
- } else {
- // Verify that all structs in the array have the correct type
- 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.get_name().c_str(), i, sTypeName);
- }
+ 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.get_name().c_str());
}
+ } else {
+ skip_call |= validate_struct_type_array(report_data, apiName, countName, arrayName, sTypeName, (*count), array, sType,
+ countValueRequired, arrayRequired);
}
return skip_call;