summaryrefslogtreecommitdiff
path: root/chapters/commonvalidity/bind_image_common.adoc
blob: 03ee73c6efac8d9e861c4d7f03b00ed91190c863 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// Copyright 2020-2023 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

// Common Valid Usage
// Common to binding any memory to an image
  * [[VUID-{refpage}-image-07460]]
    pname:image must: not have been bound to a memory object
  * [[VUID-{refpage}-image-01045]]
    pname:image must: not have been created with any sparse memory binding
    flags
  * [[VUID-{refpage}-memoryOffset-01046]]
    pname:memoryOffset must: be less than the size of pname:memory
ifdef::VK_VERSION_1_1,VK_KHR_dedicated_allocation[]
  * [[VUID-{refpage}-image-01445]]
    If pname:image requires a dedicated allocation (as reported by
    flink:vkGetImageMemoryRequirements2 in
    slink:VkMemoryDedicatedRequirements::pname:requiresDedicatedAllocation
    for pname:image), pname:memory must: have been created with
    slink:VkMemoryDedicatedAllocateInfo::pname:image equal to pname:image
ifndef::VK_NV_dedicated_allocation_image_aliasing[]
  * [[VUID-{refpage}-memory-01509]]
    If the sname:VkMemoryAllocateInfo provided when pname:memory was
    allocated included a slink:VkMemoryDedicatedAllocateInfo structure in
    its pname:pNext chain, and
    slink:VkMemoryDedicatedAllocateInfo::pname:image was not
    dlink:VK_NULL_HANDLE, then pname:image must: equal
    slink:VkMemoryDedicatedAllocateInfo::pname:image and pname:memoryOffset
    must: be zero
endif::VK_NV_dedicated_allocation_image_aliasing[]
ifdef::VK_NV_dedicated_allocation_image_aliasing[]
  * [[VUID-{refpage}-memory-02628]]
    If the <<features-dedicatedAllocationImageAliasing,
    pname:dedicatedAllocationImageAliasing>> feature is not enabled, and the
    sname:VkMemoryAllocateInfo provided when pname:memory was allocated
    included a slink:VkMemoryDedicatedAllocateInfo structure in its
    pname:pNext chain, and slink:VkMemoryDedicatedAllocateInfo::pname:image
    was not dlink:VK_NULL_HANDLE, then pname:image must: equal
    slink:VkMemoryDedicatedAllocateInfo::pname:image and pname:memoryOffset
    must: be zero
  * [[VUID-{refpage}-memory-02629]]
    If the <<features-dedicatedAllocationImageAliasing,
    pname:dedicatedAllocationImageAliasing>> feature is enabled, and the
    sname:VkMemoryAllocateInfo provided when pname:memory was allocated
    included a slink:VkMemoryDedicatedAllocateInfo structure in its
    pname:pNext chain, and slink:VkMemoryDedicatedAllocateInfo::pname:image
    was not dlink:VK_NULL_HANDLE, then pname:memoryOffset must: be zero, and
    pname:image must: be either equal to
    slink:VkMemoryDedicatedAllocateInfo::pname:image or an image that was
    created using the same parameters in slink:VkImageCreateInfo, with the
    exception that pname:extent and pname:arrayLayers may: differ subject to
    the following restrictions: every dimension in the pname:extent
    parameter of the image being bound must: be equal to or smaller than the
    original image for which the allocation was created; and the
    pname:arrayLayers parameter of the image being bound must: be equal to
    or smaller than the original image for which the allocation was created
endif::VK_NV_dedicated_allocation_image_aliasing[]
endif::VK_VERSION_1_1,VK_KHR_dedicated_allocation[]
ifdef::VK_VERSION_1_1[]
  * [[VUID-{refpage}-None-01901]]
    If image was created with the ename:VK_IMAGE_CREATE_PROTECTED_BIT bit
    set, the image must: be bound to a memory object allocated with a memory
    type that reports ename:VK_MEMORY_PROPERTY_PROTECTED_BIT
  * [[VUID-{refpage}-None-01902]]
    If image was created with the ename:VK_IMAGE_CREATE_PROTECTED_BIT bit
    not set, the image must: not be bound to a memory object created with a
    memory type that reports ename:VK_MEMORY_PROPERTY_PROTECTED_BIT
endif::VK_VERSION_1_1[]
ifdef::VK_NV_dedicated_allocation[]
  * [[VUID-{refpage}-image-01050]]
    If pname:image was created with
    slink:VkDedicatedAllocationImageCreateInfoNV::pname:dedicatedAllocation
    equal to ename:VK_TRUE, pname:memory must: have been created with
    slink:VkDedicatedAllocationMemoryAllocateInfoNV::pname:image equal to an
    image handle created with identical creation parameters to pname:image
    and pname:memoryOffset must: be zero
ifndef::VK_VERSION_1_1,VK_KHR_dedicated_allocation[]
  * [[VUID-{refpage}-image-01051]]
    If pname:image was not created with
    slink:VkDedicatedAllocationImageCreateInfoNV::pname:dedicatedAllocation
    equal to ename:VK_TRUE, pname:memory must: not have been allocated
    dedicated for a specific buffer or image
endif::VK_VERSION_1_1,VK_KHR_dedicated_allocation[]
ifdef::VK_VERSION_1_1,VK_KHR_dedicated_allocation[]
ifndef::VKSC_VERSION_1_0[]
  * [[VUID-{refpage}-apiVersion-07921]]
    If the apiext:VK_KHR_dedicated_allocation extension is not enabled,
    slink:VkPhysicalDeviceProperties::pname:apiVersion is less than Vulkan
    1.1, and pname:image was not created with
    slink:VkDedicatedAllocationImageCreateInfoNV::pname:dedicatedAllocation
    equal to ename:VK_TRUE, pname:memory must: not have been allocated
    dedicated for a specific buffer or image
endif::VKSC_VERSION_1_0[]
endif::VK_VERSION_1_1,VK_KHR_dedicated_allocation[]
endif::VK_NV_dedicated_allocation[]
ifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
  * [[VUID-{refpage}-memory-02728]]
    If the value of slink:VkExportMemoryAllocateInfo::pname:handleTypes used
    to allocate pname:memory is not `0`, it must: include at least one of
    the handles set in
    slink:VkExternalMemoryImageCreateInfo::pname:handleTypes when
    pname:image was created
ifndef::VK_ANDROID_external_memory_android_hardware_buffer[]
  * [[VUID-{refpage}-memory-02729]]
    If pname:memory was created by a memory import operation, the external
    handle type of the imported memory must: also have been set in
    slink:VkExternalMemoryImageCreateInfo::pname:handleTypes when
    pname:image was created
endif::VK_ANDROID_external_memory_android_hardware_buffer[]
ifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
  * [[VUID-{refpage}-memory-02989]]
    If pname:memory was created by a memory import operation, that is not
    slink:VkImportAndroidHardwareBufferInfoANDROID with a non-`NULL`
    pname:buffer value, the external handle type of the imported memory
    must: also have been set in
    slink:VkExternalMemoryImageCreateInfo::pname:handleTypes when
    pname:image was created
  * [[VUID-{refpage}-memory-02990]]
    If pname:memory was created with the
    slink:VkImportAndroidHardwareBufferInfoANDROID memory import operation
    with a non-`NULL` pname:buffer value,
    ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID
    must: also have been set in
    slink:VkExternalMemoryImageCreateInfo::pname:handleTypes when
    pname:image was created
endif::VK_ANDROID_external_memory_android_hardware_buffer[]
endif::VK_VERSION_1_1,VK_KHR_external_memory[]
ifdef::VK_EXT_descriptor_buffer[]
  * [[VUID-{refpage}-descriptorBufferCaptureReplay-08113]]
    If the pname:image was created with the
    ename:VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT bit set,
    pname:memory must: have been allocated with the
    ename:VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT bit set
  * [[VUID-{refpage}-image-09202]]
    If the pname:image was created with the
    ename:VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT bit set,
    pname:memory must: have been allocated with the
    ename:VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT bit set
endif::VK_EXT_descriptor_buffer[]
// Common Valid Usage