@@ -79,39 +79,39 @@ struct PhysicalDevice {
79
79
PhysicalDevice (const char * name) : deviceName(name) {}
80
80
81
81
DispatchableHandle<VkPhysicalDevice> vk_physical_device;
82
- BUILDER_VALUE (PhysicalDevice, std::string, deviceName, " " )
83
- BUILDER_VALUE (PhysicalDevice, VkPhysicalDeviceProperties, properties, {} )
84
- BUILDER_VALUE (PhysicalDevice, VkPhysicalDeviceFeatures, features, {} )
85
- BUILDER_VALUE (PhysicalDevice, VkPhysicalDeviceMemoryProperties, memory_properties, {} )
86
- BUILDER_VALUE (PhysicalDevice, VkImageFormatProperties, image_format_properties, {} )
87
- BUILDER_VALUE (PhysicalDevice, VkExternalMemoryProperties, external_memory_properties, {} )
88
- BUILDER_VALUE (PhysicalDevice, VkExternalSemaphoreProperties, external_semaphore_properties, {} )
89
- BUILDER_VALUE (PhysicalDevice, VkExternalFenceProperties, external_fence_properties, {} )
90
- BUILDER_VALUE (PhysicalDevice, uint32_t , pci_bus, {} )
91
-
92
- BUILDER_VECTOR (PhysicalDevice, MockQueueFamilyProperties, queue_family_properties, queue_family_properties)
93
- BUILDER_VECTOR (PhysicalDevice, VkFormatProperties, format_properties, format_properties)
94
- BUILDER_VECTOR (PhysicalDevice, VkSparseImageFormatProperties, sparse_image_format_properties, sparse_image_format_properties)
95
-
96
- BUILDER_VECTOR (PhysicalDevice, Extension, extensions, extension)
97
-
98
- BUILDER_VALUE (PhysicalDevice, VkSurfaceCapabilitiesKHR, surface_capabilities, {} )
99
- BUILDER_VECTOR (PhysicalDevice, VkSurfaceFormatKHR, surface_formats, surface_format)
100
- BUILDER_VECTOR (PhysicalDevice, VkPresentModeKHR, surface_present_modes, surface_present_mode)
101
- BUILDER_VALUE (PhysicalDevice, VkSurfacePresentScalingCapabilitiesEXT, surface_present_scaling_capabilities, {} )
82
+ BUILDER_VALUE (std::string, deviceName)
83
+ BUILDER_VALUE (VkPhysicalDeviceProperties, properties)
84
+ BUILDER_VALUE (VkPhysicalDeviceFeatures, features)
85
+ BUILDER_VALUE (VkPhysicalDeviceMemoryProperties, memory_properties)
86
+ BUILDER_VALUE (VkImageFormatProperties, image_format_properties)
87
+ BUILDER_VALUE (VkExternalMemoryProperties, external_memory_properties)
88
+ BUILDER_VALUE (VkExternalSemaphoreProperties, external_semaphore_properties)
89
+ BUILDER_VALUE (VkExternalFenceProperties, external_fence_properties)
90
+ BUILDER_VALUE (uint32_t , pci_bus)
91
+
92
+ BUILDER_VECTOR (MockQueueFamilyProperties, queue_family_properties, queue_family_properties)
93
+ BUILDER_VECTOR (VkFormatProperties, format_properties, format_properties)
94
+ BUILDER_VECTOR (VkSparseImageFormatProperties, sparse_image_format_properties, sparse_image_format_properties)
95
+
96
+ BUILDER_VECTOR (Extension, extensions, extension)
97
+
98
+ BUILDER_VALUE (VkSurfaceCapabilitiesKHR, surface_capabilities)
99
+ BUILDER_VECTOR (VkSurfaceFormatKHR, surface_formats, surface_format)
100
+ BUILDER_VECTOR (VkPresentModeKHR, surface_present_modes, surface_present_mode)
101
+ BUILDER_VALUE (VkSurfacePresentScalingCapabilitiesEXT, surface_present_scaling_capabilities)
102
102
// No good way to make this a builder value. Each std::vector<VkPresentModeKHR> corresponds to each surface_present_modes
103
103
// element
104
104
std::vector<std::vector<VkPresentModeKHR>> surface_present_mode_compatibility{};
105
105
106
- BUILDER_VECTOR (PhysicalDevice, VkDisplayPropertiesKHR, display_properties, display_properties)
107
- BUILDER_VECTOR (PhysicalDevice, VkDisplayPlanePropertiesKHR, display_plane_properties, display_plane_properties)
108
- BUILDER_VECTOR (PhysicalDevice, VkDisplayKHR, displays, displays)
109
- BUILDER_VECTOR (PhysicalDevice, VkDisplayModePropertiesKHR, display_mode_properties, display_mode_properties)
110
- BUILDER_VALUE (PhysicalDevice, VkDisplayModeKHR, display_mode, {} )
111
- BUILDER_VALUE (PhysicalDevice, VkDisplayPlaneCapabilitiesKHR, display_plane_capabilities, {} )
106
+ BUILDER_VECTOR (VkDisplayPropertiesKHR, display_properties, display_properties)
107
+ BUILDER_VECTOR (VkDisplayPlanePropertiesKHR, display_plane_properties, display_plane_properties)
108
+ BUILDER_VECTOR (VkDisplayKHR, displays, displays)
109
+ BUILDER_VECTOR (VkDisplayModePropertiesKHR, display_mode_properties, display_mode_properties)
110
+ BUILDER_VALUE (VkDisplayModeKHR, display_mode)
111
+ BUILDER_VALUE (VkDisplayPlaneCapabilitiesKHR, display_plane_capabilities)
112
112
113
- BUILDER_VALUE (PhysicalDevice, VkLayeredDriverUnderlyingApiMSFT, layered_driver_underlying_api,
114
- VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT)
113
+ BUILDER_VALUE_WITH_DEFAULT ( VkLayeredDriverUnderlyingApiMSFT, layered_driver_underlying_api,
114
+ VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT)
115
115
116
116
PhysicalDevice& set_api_version (uint32_t version) {
117
117
properties.apiVersion = version;
@@ -128,12 +128,12 @@ struct PhysicalDevice {
128
128
// Unknown physical device functions. Add a `VulkanFunction` to this list which will be searched in
129
129
// vkGetInstanceProcAddr for custom_instance_functions and vk_icdGetPhysicalDeviceProcAddr for custom_physical_device_functions.
130
130
// To add unknown device functions, add it to the PhysicalDevice directly (in the known_device_functions member)
131
- BUILDER_VECTOR (PhysicalDevice, VulkanFunction, custom_physical_device_functions, custom_physical_device_function)
131
+ BUILDER_VECTOR (VulkanFunction, custom_physical_device_functions, custom_physical_device_function)
132
132
133
133
// List of function names which are 'known' to the physical device but have test defined implementations
134
134
// The purpose of this list is so that vkGetDeviceProcAddr returns 'a real function pointer' in tests
135
135
// without actually implementing any of the logic inside of it.
136
- BUILDER_VECTOR (PhysicalDevice, VulkanFunction, known_device_functions, device_function)
136
+ BUILDER_VECTOR (VulkanFunction, known_device_functions, device_function)
137
137
};
138
138
139
139
struct PhysicalDeviceGroup {
@@ -154,25 +154,25 @@ struct PhysicalDeviceGroup {
154
154
struct TestICD {
155
155
std::filesystem::path manifest_file_path;
156
156
157
- BUILDER_VALUE (TestICD, bool , exposes_vk_icdNegotiateLoaderICDInterfaceVersion, true )
158
- BUILDER_VALUE (TestICD, bool , exposes_vkEnumerateInstanceExtensionProperties, true )
159
- BUILDER_VALUE (TestICD, bool , exposes_vkCreateInstance, true )
160
- BUILDER_VALUE (TestICD, bool , exposes_vk_icdGetPhysicalDeviceProcAddr, true )
157
+ BUILDER_VALUE_WITH_DEFAULT ( bool , exposes_vk_icdNegotiateLoaderICDInterfaceVersion, true )
158
+ BUILDER_VALUE_WITH_DEFAULT ( bool , exposes_vkEnumerateInstanceExtensionProperties, true )
159
+ BUILDER_VALUE_WITH_DEFAULT ( bool , exposes_vkCreateInstance, true )
160
+ BUILDER_VALUE_WITH_DEFAULT ( bool , exposes_vk_icdGetPhysicalDeviceProcAddr, true )
161
161
#if defined(WIN32)
162
- BUILDER_VALUE (TestICD, bool , exposes_vk_icdEnumerateAdapterPhysicalDevices, true )
162
+ BUILDER_VALUE_WITH_DEFAULT ( bool , exposes_vk_icdEnumerateAdapterPhysicalDevices, true )
163
163
#endif
164
164
165
165
CalledICDGIPA called_vk_icd_gipa = CalledICDGIPA::not_called;
166
166
CalledNegotiateInterface called_negotiate_interface = CalledNegotiateInterface::not_called;
167
167
168
168
InterfaceVersionCheck interface_version_check = InterfaceVersionCheck::not_called;
169
- BUILDER_VALUE (TestICD, uint32_t , min_icd_interface_version, 0 )
170
- BUILDER_VALUE (TestICD, uint32_t , max_icd_interface_version, 7 )
169
+ BUILDER_VALUE_WITH_DEFAULT ( uint32_t , min_icd_interface_version, 0 )
170
+ BUILDER_VALUE_WITH_DEFAULT ( uint32_t , max_icd_interface_version, 7 )
171
171
uint32_t icd_interface_version_received = 0 ;
172
172
173
173
bool called_enumerate_adapter_physical_devices = false ;
174
174
175
- BUILDER_VALUE (TestICD, bool , enable_icd_wsi, false );
175
+ BUILDER_VALUE (bool , enable_icd_wsi);
176
176
bool is_using_icd_wsi = false ;
177
177
178
178
TestICD& setup_WSI (const char * api_selection = nullptr ) {
@@ -182,14 +182,14 @@ struct TestICD {
182
182
return *this ;
183
183
}
184
184
185
- BUILDER_VALUE (TestICD, uint32_t , icd_api_version, VK_API_VERSION_1_0)
186
- BUILDER_VECTOR (TestICD, LayerDefinition, instance_layers, instance_layer)
187
- BUILDER_VECTOR (TestICD, Extension, instance_extensions, instance_extension)
185
+ BUILDER_VALUE_WITH_DEFAULT ( uint32_t , icd_api_version, VK_API_VERSION_1_0)
186
+ BUILDER_VECTOR (LayerDefinition, instance_layers, instance_layer)
187
+ BUILDER_VECTOR (Extension, instance_extensions, instance_extension)
188
188
std::vector<Extension> enabled_instance_extensions;
189
189
190
- BUILDER_VECTOR_MOVE_ONLY (TestICD, PhysicalDevice, physical_devices, physical_device);
190
+ BUILDER_VECTOR_MOVE_ONLY (PhysicalDevice, physical_devices, physical_device);
191
191
192
- BUILDER_VECTOR (TestICD, PhysicalDeviceGroup, physical_device_groups, physical_device_group);
192
+ BUILDER_VECTOR (PhysicalDeviceGroup, physical_device_groups, physical_device_group);
193
193
194
194
DispatchableHandle<VkInstance> instance_handle;
195
195
std::vector<DispatchableHandle<VkDevice>> device_handles;
@@ -198,27 +198,27 @@ struct TestICD {
198
198
std::vector<uint64_t > callback_handles;
199
199
std::vector<uint64_t > swapchain_handles;
200
200
201
- BUILDER_VALUE (TestICD, bool , can_query_vkEnumerateInstanceVersion, true );
202
- BUILDER_VALUE (TestICD, bool , can_query_GetPhysicalDeviceFuncs, true );
201
+ BUILDER_VALUE_WITH_DEFAULT ( bool , can_query_vkEnumerateInstanceVersion, true );
202
+ BUILDER_VALUE_WITH_DEFAULT ( bool , can_query_GetPhysicalDeviceFuncs, true );
203
203
204
204
// Unknown instance functions Add a `VulkanFunction` to this list which will be searched in
205
205
// vkGetInstanceProcAddr for custom_instance_functions and vk_icdGetPhysicalDeviceProcAddr for
206
206
// custom_physical_device_functions. To add unknown device functions, add it to the PhysicalDevice directly (in the
207
207
// known_device_functions member)
208
- BUILDER_VECTOR (TestICD, VulkanFunction, custom_instance_functions, custom_instance_function)
208
+ BUILDER_VECTOR (VulkanFunction, custom_instance_functions, custom_instance_function)
209
209
210
210
// Must explicitely state support for the tooling info extension, that way we can control if vkGetInstanceProcAddr returns a
211
211
// function pointer for vkGetPhysicalDeviceToolPropertiesEXT or vkGetPhysicalDeviceToolProperties (core version)
212
- BUILDER_VALUE (TestICD, bool , supports_tooling_info_ext, false );
213
- BUILDER_VALUE (TestICD, bool , supports_tooling_info_core, false );
212
+ BUILDER_VALUE (bool , supports_tooling_info_ext);
213
+ BUILDER_VALUE (bool , supports_tooling_info_core);
214
214
// List of tooling properties that this driver 'supports'
215
- BUILDER_VECTOR (TestICD, VkPhysicalDeviceToolPropertiesEXT, tooling_properties, tooling_property)
215
+ BUILDER_VECTOR (VkPhysicalDeviceToolPropertiesEXT, tooling_properties, tooling_property)
216
216
std::vector<DispatchableHandle<VkCommandBuffer>> allocated_command_buffers;
217
217
218
218
VkInstanceCreateFlags passed_in_instance_create_flags{};
219
219
220
- BUILDER_VALUE (TestICD, VkResult, enum_physical_devices_return_code, VK_SUCCESS);
221
- BUILDER_VALUE (TestICD, VkResult, enum_adapter_physical_devices_return_code, VK_SUCCESS);
220
+ BUILDER_VALUE_WITH_DEFAULT ( VkResult, enum_physical_devices_return_code, VK_SUCCESS);
221
+ BUILDER_VALUE_WITH_DEFAULT ( VkResult, enum_adapter_physical_devices_return_code, VK_SUCCESS);
222
222
223
223
PhysicalDevice& GetPhysDevice (VkPhysicalDevice physicalDevice) {
224
224
for (auto & phys_dev : physical_devices) {
@@ -258,7 +258,7 @@ struct TestICD {
258
258
}
259
259
260
260
#if defined(WIN32)
261
- BUILDER_VALUE (TestICD, LUID, adapterLUID, {} )
261
+ BUILDER_VALUE (LUID, adapterLUID)
262
262
#endif // defined(WIN32)
263
263
};
264
264
0 commit comments