Skip to content

Commit f1b4e53

Browse files
committed
Example VUs -- post-english changes
1 parent 1dfcb0b commit f1b4e53

6 files changed

+94
-93
lines changed

chapters/clears.adoc

+27-29
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
5151
must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
5252
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
5353
* [[VUID-vkCmdClearColorImage-image-00002]]
54-
pname:image must: have been created with
55-
ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
54+
codified-vu
55+
require(image.create_info().usage.has_bit(VK_IMAGE_USAGE_TRANSFER_DST_BIT))
5656
ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
5757
* [[VUID-vkCmdClearColorImage-image-01545]]
5858
pname:image must: not use any of the
@@ -67,38 +67,36 @@ endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6767
ranges of pname:image specified in pname:pRanges at the time this
6868
command is executed on a sname:VkDevice
6969
* [[VUID-vkCmdClearColorImage-imageLayout-01394]]
70-
pname:imageLayout must: be
71-
ifdef::VK_KHR_shared_presentable_image[]
72-
ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,
73-
endif::VK_KHR_shared_presentable_image[]
74-
ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
75-
ename:VK_IMAGE_LAYOUT_GENERAL
70+
codified-vu
71+
require(imageLayout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
72+
imageLayout == VK_IMAGE_LAYOUT_GENERAL or
73+
imageLayout == VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR)
7674
* [[VUID-vkCmdClearColorImage-aspectMask-02498]]
77-
The slink:VkImageSubresourceRange::pname:aspectMask members of the
78-
elements of the pname:pRanges array must: each only include
79-
ename:VK_IMAGE_ASPECT_COLOR_BIT
75+
codified-vu
76+
for range in pRanges:
77+
require(range.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT)
8078
* [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
81-
The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
82-
elements of the pname:pRanges array must: each be less than the
83-
pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
84-
was created
79+
codified-vu
80+
mipLevels = image.create_info().mipLevels
81+
for range in pRanges:
82+
require(range.baseMipLevel < mipLevels)
8583
* [[VUID-vkCmdClearColorImage-pRanges-01692]]
86-
For each slink:VkImageSubresourceRange element of pname:pRanges, if the
87-
pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
88-
[eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
89-
equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
90-
pname:image was created
84+
codified-vu
85+
mipLevels = image.create_info().mipLevels
86+
for range in pRanges:
87+
if range.levelCount != VK_REMAINING_MIP_LEVELS:
88+
require(range.baseMipLevel + range.levelCount <= mipLevels)
9189
* [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
92-
The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the
93-
elements of the pname:pRanges array must: each be less than the
94-
pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
95-
was created
90+
codified-vu
91+
arrayLayers = image.create_info().arrayLayers
92+
for range in pRanges:
93+
require(range.baseArrayLayer < arrayLayers)
9694
* [[VUID-vkCmdClearColorImage-pRanges-01693]]
97-
For each slink:VkImageSubresourceRange element of pname:pRanges, if the
98-
pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
99-
[eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or
100-
equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
101-
pname:image was created
95+
codified-vu
96+
arrayLayers = image.create_info().arrayLayers
97+
for range in pRanges:
98+
if range.layerCount != VK_REMAINING_ARRAY_LAYERS:
99+
require(range.baseArrayLayer + range.layerCount <= arrayLayers)
102100
* [[VUID-vkCmdClearColorImage-image-00007]]
103101
pname:image must: not have a compressed or depth/stencil format
104102
* [[VUID-vkCmdClearColorImage-pColor-04961]]

chapters/commonvalidity/copy_bufferimage_to_imagebuffer_common.adoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
// corresponding to the offset and extent of the copy.
1515

1616
* [[VUID-{refpage}-{imageparam}-07979]]
17-
If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D, then for each
18-
element of pname:pRegions, pname:{imageoffset}.y must: be `0` and
19-
pname:{imageextent}.height must: be `1`
17+
codified-vu
18+
if macro(imageparam).create_info().imageType == VK_IMAGE_TYPE_1D:
19+
for region in pRegions:
20+
require(region.macro(imageoffset).y == 0)
21+
require(region.macro(imageextent).height == 1)
2022
* [[VUID-{refpage}-{imageoffset}-09104]]
2123
For each element of pname:pRegions, pname:{imageoffset}.z and
2224
[eq]#(pname:{imageextent}.depth {plus} pname:{imageoffset}.z)# must:

chapters/descriptorsets.adoc

+34-34
Original file line numberDiff line numberDiff line change
@@ -608,16 +608,12 @@ endif::VK_VERSION_1_4,VK_KHR_push_descriptor[]
608608
.Valid Usage
609609
****
610610
* [[VUID-VkDescriptorSetLayoutCreateInfo-binding-00279]]
611-
ifdef::VK_NV_per_stage_descriptor_set[]
612-
If the <<features-perStageDescriptorSet, pname:perStageDescriptorSet>>
613-
feature is not enabled, or pname:flags does not contain
614-
ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV, then the
615-
endif::VK_NV_per_stage_descriptor_set[]
616-
ifndef::VK_NV_per_stage_descriptor_set[]
617-
The
618-
endif::VK_NV_per_stage_descriptor_set[]
619-
slink:VkDescriptorSetLayoutBinding::pname:binding members of the
620-
elements of the pname:pBindings array must: each have different values
611+
codified-vu
612+
if not is_feature_enabled(perStageDescriptorSet) and not flags.has_bit(VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV):
613+
for binding in pBindings:
614+
for binding2 in pBindings:
615+
if array_index(binding2) != array_index(binding):
616+
require(binding.binding != binding2.binding)
621617
ifdef::VK_VERSION_1_4[]
622618
* [[VUID-VkDescriptorSetLayoutCreateInfo-flags-10354]]
623619
If pname:flags contains
@@ -629,17 +625,17 @@ endif::VK_KHR_push_descriptor[]
629625
endif::VK_VERSION_1_4[]
630626
ifdef::VK_VERSION_1_4,VK_KHR_push_descriptor[]
631627
* [[VUID-VkDescriptorSetLayoutCreateInfo-flags-00280]]
632-
If pname:flags contains
633-
ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT, then all
634-
elements of pname:pBindings must: not have a pname:descriptorType of
635-
ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or
636-
ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
628+
codified-vu
629+
if flags.has_bit(VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT):
630+
for binding in pBindings:
631+
require(binding.descriptorType != VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC and
632+
binding.descriptorType != VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
637633
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
638634
* [[VUID-VkDescriptorSetLayoutCreateInfo-flags-02208]]
639-
If pname:flags contains
640-
ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT, then all
641-
elements of pname:pBindings must: not have a pname:descriptorType of
642-
ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
635+
codified-vu
636+
if flags.has_bit(VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT):
637+
for binding in pBindings:
638+
require(binding.descriptorType != VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK)
643639
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
644640
* [[VUID-VkDescriptorSetLayoutCreateInfo-flags-00281]]
645641
If pname:flags contains
@@ -648,22 +644,24 @@ endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
648644
slink:VkPhysicalDevicePushDescriptorProperties::pname:maxPushDescriptors
649645
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
650646
* [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04590]]
651-
If pname:flags contains
652-
ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT, pname:flags
653-
must: not contain
654-
ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT
647+
codified-vu
648+
if flags.has_bit(VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT):
649+
require(not flags.has_bit(VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT))
655650
* [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04591]]
656-
If pname:flags contains
657-
ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT,
658-
pname:pBindings must: not have a pname:descriptorType of
659-
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
651+
codified-vu
652+
if flags.has_bit(VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT):
653+
for binding in pBindings:
654+
require(binding.descriptorType != VK_DESCRIPTOR_TYPE_MUTABLE_EXT)
660655
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
661656
endif::VK_VERSION_1_4,VK_KHR_push_descriptor[]
662657
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
663658
* [[VUID-VkDescriptorSetLayoutCreateInfo-flags-03000]]
664-
If any binding has the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
665-
bit set, pname:flags must: include
666-
ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT
659+
codified-vu
660+
if has_pnext(VkDescriptorSetLayoutBindingFlagsCreateInfo):
661+
bindingFlagsCreateInfo = pnext(VkDescriptorSetLayoutBindingFlagsCreateInfo)
662+
for bindingFlags in bindingFlagsCreateInfo.pBindingFlags:
663+
if bindingFlags.has_bit(VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT):
664+
require(flags.has_bit(VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT))
667665
* [[VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001]]
668666
If any binding has the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
669667
bit set, then all bindings must: not have pname:descriptorType of
@@ -679,10 +677,12 @@ endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
679677
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
680678
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
681679
* [[VUID-VkDescriptorSetLayoutCreateInfo-pBindings-07303]]
682-
If any element pname:pBindings[i] has a pname:descriptorType of
683-
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, then the pname:pNext chain must:
684-
include a slink:VkMutableDescriptorTypeCreateInfoEXT structure, and
685-
pname:mutableDescriptorTypeListCount must: be greater than i
680+
codified-vu
681+
for binding in pBindings:
682+
if binding.descriptorType == VK_DESCRIPTOR_TYPE_MUTABLE_EXT:
683+
require(has_pnext(VkMutableDescriptorTypeCreateInfoEXT))
684+
mutableCount = pnext(VkMutableDescriptorTypeCreateInfoEXT).mutableDescriptorTypeListCount
685+
require(mutableCount > array_index(binding))
686686
* [[VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-04594]]
687687
If a binding has a pname:descriptorType value of
688688
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, then sname:pImmutableSamplers

chapters/devsandqueues.adoc

+8-7
Original file line numberDiff line numberDiff line change
@@ -1972,13 +1972,14 @@ include::{generated}/api/structs/VkDeviceCreateInfo.adoc[]
19721972
.Valid Usage
19731973
****
19741974
* [[VUID-VkDeviceCreateInfo-queueFamilyIndex-02802]]
1975-
The pname:queueFamilyIndex member of each element of
1976-
pname:pQueueCreateInfos must: be unique within pname:pQueueCreateInfos
1977-
ifdef::VK_VERSION_1_1[]
1978-
, except that two members can share the same pname:queueFamilyIndex if
1979-
one describes protected-capable queues and one describes queues that are
1980-
not protected-capable
1981-
endif::VK_VERSION_1_1[]
1975+
codified-vu
1976+
for queue in pQueueCreateInfos:
1977+
for queue2 in pQueueCreateInfos:
1978+
if array_index(queue2) != array_index(queue):
1979+
protected = queue.flags.has_bit(VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT)
1980+
protected2 = queue2.flags.has_bit(VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT)
1981+
require(queue.queueFamilyIndex != queue2.queueFamilyIndex or
1982+
protected != protected2)
19821983
ifdef::VK_VERSION_1_1[]
19831984
* [[VUID-VkDeviceCreateInfo-pQueueCreateInfos-06755]]
19841985
If multiple elements of pname:pQueueCreateInfos share the same

chapters/pipelines.adoc

+13-13
Original file line numberDiff line numberDiff line change
@@ -284,23 +284,23 @@ include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]
284284
ename:VK_QUEUE_COMPUTE_BIT capability
285285
ifndef::VKSC_VERSION_1_0[]
286286
* [[VUID-vkCreateComputePipelines-flags-00695]]
287-
If the pname:flags member of any element of pname:pCreateInfos contains
288-
the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and the
289-
pname:basePipelineIndex member of that same element is not `-1`,
290-
pname:basePipelineIndex must: be less than the index into
291-
pname:pCreateInfos that corresponds to that element
287+
codified-vu
288+
for info in pCreateInfos:
289+
if (info.flags.has_bit(VK_PIPELINE_CREATE_DERIVATIVE_BIT) and
290+
info.basePipelineIndex != -1):
291+
require(info.basePipelineIndex < array_index(info))
292292
* [[VUID-vkCreateComputePipelines-flags-00696]]
293-
If the pname:flags member of any element of pname:pCreateInfos contains
294-
the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, the base pipeline
295-
must: have been created with the
296-
ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag set
293+
codified-vu
294+
for info in pCreateInfos:
295+
if (info.flags.has_bit(VK_PIPELINE_CREATE_DERIVATIVE_BIT) and
296+
info.basePipelineIndex != -1):
297+
require(pCreateInfos[info.basePipelineIndex].flags.has_bit(VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT))
297298
endif::VKSC_VERSION_1_0[]
298299
ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
299300
* [[VUID-vkCreateComputePipelines-pipelineCache-02873]]
300-
If pname:pipelineCache was created with
301-
ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, host access
302-
to pname:pipelineCache must: be
303-
<<fundamentals-threadingbehavior,externally synchronized>>
301+
codified-vu
302+
if pipelineCache.create_info().flags.has_bit(VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT):
303+
require(externally_synchronized(pipelineCache))
304304
endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
305305
include::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[]
306306
include::{chapters}/commonvalidity/pipeline_create_common.adoc[]

chapters/renderpass.adoc

+7-7
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,13 @@ ifdef::VK_KHR_maintenance2,VK_VERSION_1_1[]
405405
not be ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
406406
or ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
407407
* [[VUID-VkRenderingInfo-colorAttachmentCount-06097]]
408-
If pname:colorAttachmentCount is not `0` and the pname:imageView member
409-
of an element of pname:pColorAttachments is not dlink:VK_NULL_HANDLE, if
410-
the pname:resolveMode member of that element of pname:pColorAttachments
411-
is not ename:VK_RESOLVE_MODE_NONE, its pname:resolveImageLayout member
412-
must: not be
413-
ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL or
414-
ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
408+
codified-vu
409+
for attachment in pColorAttachments:
410+
if (attachment.imageView != VK_NULL_HANDLE and
411+
attachment.resolveMode != VK_RESOLVE_MODE_NONE):
412+
resolveLayout = attachment.resolveImageLayout
413+
require(resolveLayout != VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL and
414+
resolveLayout != VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL)
415415
* [[VUID-VkRenderingInfo-pDepthAttachment-06098]]
416416
If pname:pDepthAttachment is not `NULL`,
417417
pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, and

0 commit comments

Comments
 (0)