@@ -123,12 +123,6 @@ VkDevice create_logical_device(
123123 defined (ETVK_INSPECT_PIPELINES)
124124 VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME,
125125#endif /* VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES */
126- #ifdef VK_KHR_cooperative_matrix
127- VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME,
128- #endif /* VK_KHR_cooperative_matrix */
129- #ifdef VK_NV_cooperative_matrix2
130- VK_NV_COOPERATIVE_MATRIX_2_EXTENSION_NAME,
131- #endif /* VK_NV_cooperative_matrix2 */
132126 };
133127
134128 std::vector<const char *> enabled_device_extensions;
@@ -185,20 +179,6 @@ VkDevice create_logical_device(
185179 extension_list_top = &shader_int_dot_product_features;
186180#endif /* VK_KHR_shader_integer_dot_product */
187181
188- #ifdef VK_KHR_cooperative_matrix
189- VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperative_matrix_features{
190- physical_device.cooperative_matrix_features };
191- cooperative_matrix_features.pNext = extension_list_top;
192- extension_list_top = &cooperative_matrix_features;
193- #endif /* VK_KHR_cooperative_matrix */
194-
195- #ifdef VK_NV_cooperative_matrix2
196- VkPhysicalDeviceCooperativeMatrix2FeaturesNV cooperative_matrix2_features{
197- physical_device.cooperative_matrix2_features };
198- cooperative_matrix2_features.pNext = extension_list_top;
199- extension_list_top = &cooperative_matrix2_features;
200- #endif /* VK_NV_cooperative_matrix2 */
201-
202182 device_create_info.pNext = extension_list_top;
203183
204184 VkDevice handle = nullptr ;
@@ -215,7 +195,9 @@ VkDevice create_logical_device(
215195 return handle;
216196}
217197
218- bool test_linear_tiling_3d_image_support (VkDevice device) {
198+ bool test_linear_tiling_3d_image_support (
199+ VkDevice device,
200+ VkPhysicalDevice physical_device) {
219201 // Test creating a 3D image with linear tiling to see if it is supported.
220202 // According to the Vulkan spec, linear tiling may not be supported for 3D
221203 // images.
@@ -242,9 +224,15 @@ bool test_linear_tiling_3d_image_support(VkDevice device) {
242224
243225 if (res == VK_SUCCESS) {
244226 vkDestroyImage (device, image, nullptr );
227+
228+ VkFormatProperties props;
229+ vkGetPhysicalDeviceFormatProperties (
230+ physical_device, VK_FORMAT_R32G32B32A32_SFLOAT, &props);
231+
232+ return props.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
245233 }
246234
247- return res == VK_SUCCESS ;
235+ return false ;
248236}
249237
250238} // namespace
@@ -275,8 +263,9 @@ Adapter::Adapter(
275263 compute_pipeline_cache_ (device_.handle, cache_data_path),
276264 sampler_cache_ (device_.handle),
277265 vma_ (instance_, physical_device_.handle, device_.handle),
278- linear_tiling_3d_enabled_{
279- test_linear_tiling_3d_image_support (device_.handle )},
266+ linear_tiling_3d_enabled_{test_linear_tiling_3d_image_support (
267+ device_.handle ,
268+ physical_device_.handle )},
280269 owns_device_{true } {}
281270
282271Adapter::Adapter (
@@ -286,7 +275,7 @@ Adapter::Adapter(
286275 const uint32_t num_queues,
287276 const std::string& cache_data_path)
288277 : queue_usage_mutex_{},
289- physical_device_ (instance, physical_device),
278+ physical_device_ (physical_device),
290279 queues_{},
291280 queue_usage_{},
292281 queue_mutexes_{},
@@ -298,8 +287,9 @@ Adapter::Adapter(
298287 compute_pipeline_cache_ (device_.handle, cache_data_path),
299288 sampler_cache_ (device_.handle),
300289 vma_ (instance_, physical_device_.handle, device_.handle),
301- linear_tiling_3d_enabled_{
302- test_linear_tiling_3d_image_support (device_.handle )},
290+ linear_tiling_3d_enabled_{test_linear_tiling_3d_image_support (
291+ device_.handle ,
292+ physical_device_.handle )},
303293 owns_device_{false } {
304294 std::vector<VkDeviceQueueCreateInfo> queue_create_infos;
305295 std::vector<std::pair<uint32_t , uint32_t >> queues_to_get;
@@ -375,10 +365,6 @@ void Adapter::submit_cmd(
375365 VK_CHECK (vkQueueSubmit (device_queue.handle , 1u , &submit_info, fence));
376366}
377367
378- void Adapter::override_device_name (const std::string& new_name) {
379- physical_device_.override_device_name (new_name);
380- }
381-
382368std::string Adapter::stringize () const {
383369 std::stringstream ss;
384370
0 commit comments