-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address feedback on enum validation #2087
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -877,12 +877,11 @@ Specification_, can: be `NULL`. | |
[[fundamentals-validusage-enums]] | ||
==== Valid Usage for Enumerated Types | ||
|
||
Any parameter of an enumerated type must: be a valid enumerant for that | ||
type. | ||
Use of an enumerant is valid if the following conditions are true: | ||
An enumerant value is valid for a particular use if the following conditions | ||
are true: | ||
|
||
* The enumerant is defined as part of the enumerated type. | ||
* The enumerant is not a value suffixed with etext:_MAX_ENUM^1^. | ||
* The enumerant is not a value suffixed with etext:_MAX_ENUM. | ||
** This value exists only to ensure that C `enum` types are 32 bits in | ||
size and must: not be used by applications. | ||
* If the enumerant is used in a function that has a slink:VkInstance as | ||
|
@@ -897,18 +896,34 @@ endif::VK_VERSION_1_1[] | |
for the instance. | ||
* If the enumerant is used in a function that has a slink:VkPhysicalDevice | ||
object as its first parameter and either: | ||
ifdef::VK_KHR_get_physical_device_properties2,VK_VERSION_1_1[] | ||
** it was added by a <<extensions, device extension>> that is supported by | ||
that physical device and | ||
ifdef::VK_KHR_get_physical_device_properties2[] | ||
apiext:VK_KHR_get_physical_device_properties2 was enabled for the current | ||
instance | ||
endif::VK_KHR_get_physical_device_properties2[] | ||
ifdef::VK_KHR_get_physical_device_properties2+VK_VERSION_1_1[or] | ||
ifdef::VK_VERSION_1_1[] | ||
the value of slink:VkApplicationInfo::pname:apiVersion is greater | ||
than or equal to Vulkan 1.1 | ||
endif::VK_VERSION_1_1[] | ||
; | ||
endif::VK_KHR_get_physical_device_properties2,VK_VERSION_1_1[] | ||
** it was added by a core version that is supported by that device (as | ||
reported by slink:VkPhysicalDeviceProperties::pname:apiVersion); | ||
reported by slink:VkPhysicalDeviceProperties::pname:apiVersion) and the | ||
value of slink:VkApplicationInfo::pname:apiVersion is greater than or | ||
equal to the version that added it; or | ||
** it was added by an <<extensions, instance extension>> that was enabled | ||
for the instance; or | ||
** it was added by a <<extensions, device extension>> that is supported by | ||
that device. | ||
* If the enumerant is used in a function that has any other dispatchable | ||
object as its first parameter and either: | ||
for the current instance. | ||
* If the enumerant is used in a function that has a dispatchable object | ||
created or allocated from a device as its first parameter and either: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is incorrect. Either "dispatchable object created or allocated from a physical device" or "dispatchable object that is device or its children". |
||
** it was added by a core version that is supported for the device (as | ||
reported by slink:VkPhysicalDeviceProperties::pname:apiVersion); or | ||
reported by slink:VkPhysicalDeviceProperties::pname:apiVersion) | ||
and the value of slink:VkApplicationInfo::pname:apiVersion is greater | ||
than or equal to the version that added it; or | ||
** it was added by a <<extensions, device extension>> that was enabled for | ||
the device. | ||
the current device. | ||
|
||
Any enumerated type returned from a query command or otherwise output from | ||
Vulkan to the application must: not have a reserved value. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,6 +233,9 @@ include::{generated}/api/protos/vkEnumerateInstanceVersion.adoc[] | |
of Vulkan supported by instance-level functionality, encoded as | ||
described in <<extendingvulkan-coreversions-versionnumbers>>. | ||
|
||
If flink:vkGetInstanceProcAddr returns a code:NULL pointer when this | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think styleguide uses only ticks for NULL |
||
function is queried, the implementation only supports Vulkan version 1.0. | ||
|
||
[NOTE] | ||
.Note | ||
==== | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe "all the following conditions".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're inconsistent about whether we use "all". I agree it wouldn't hurt!