166
panvk_get_features(const struct panvk_physical_device *device,
167
struct vk_features *features)
169
*features = (struct vk_features){
171
.robustBufferAccess = true,
172
.fullDrawIndexUint32 = true,
173
.independentBlend = true,
177
.textureCompressionETC2 = true,
178
.textureCompressionASTC_LDR = true,
179
.shaderUniformBufferArrayDynamicIndexing = true,
180
.shaderSampledImageArrayDynamicIndexing = true,
181
.shaderStorageBufferArrayDynamicIndexing = true,
182
.shaderStorageImageArrayDynamicIndexing = true,
185
.storageBuffer16BitAccess = false,
186
.uniformAndStorageBuffer16BitAccess = false,
187
.storagePushConstant16 = false,
188
.storageInputOutput16 = false,
190
.multiviewGeometryShader = false,
191
.multiviewTessellationShader = false,
192
.variablePointersStorageBuffer = true,
193
.variablePointers = true,
194
.protectedMemory = false,
195
.samplerYcbcrConversion = false,
196
.shaderDrawParameters = false,
199
.samplerMirrorClampToEdge = false,
200
.drawIndirectCount = false,
201
.storageBuffer8BitAccess = false,
202
.uniformAndStorageBuffer8BitAccess = false,
203
.storagePushConstant8 = false,
204
.shaderBufferInt64Atomics = false,
205
.shaderSharedInt64Atomics = false,
206
.shaderFloat16 = false,
209
.descriptorIndexing = false,
210
.shaderInputAttachmentArrayDynamicIndexing = false,
211
.shaderUniformTexelBufferArrayDynamicIndexing = false,
212
.shaderStorageTexelBufferArrayDynamicIndexing = false,
213
.shaderUniformBufferArrayNonUniformIndexing = false,
214
.shaderSampledImageArrayNonUniformIndexing = false,
215
.shaderStorageBufferArrayNonUniformIndexing = false,
216
.shaderStorageImageArrayNonUniformIndexing = false,
217
.shaderInputAttachmentArrayNonUniformIndexing = false,
218
.shaderUniformTexelBufferArrayNonUniformIndexing = false,
219
.shaderStorageTexelBufferArrayNonUniformIndexing = false,
220
.descriptorBindingUniformBufferUpdateAfterBind = false,
221
.descriptorBindingSampledImageUpdateAfterBind = false,
222
.descriptorBindingStorageImageUpdateAfterBind = false,
223
.descriptorBindingStorageBufferUpdateAfterBind = false,
224
.descriptorBindingUniformTexelBufferUpdateAfterBind = false,
225
.descriptorBindingStorageTexelBufferUpdateAfterBind = false,
226
.descriptorBindingUpdateUnusedWhilePending = false,
227
.descriptorBindingPartiallyBound = false,
228
.descriptorBindingVariableDescriptorCount = false,
229
.runtimeDescriptorArray = false,
231
.samplerFilterMinmax = false,
232
.scalarBlockLayout = false,
233
.imagelessFramebuffer = false,
234
.uniformBufferStandardLayout = false,
235
.shaderSubgroupExtendedTypes = false,
236
.separateDepthStencilLayouts = false,
237
.hostQueryReset = false,
238
.timelineSemaphore = false,
239
.bufferDeviceAddress = false,
240
.bufferDeviceAddressCaptureReplay = false,
241
.bufferDeviceAddressMultiDevice = false,
242
.vulkanMemoryModel = false,
243
.vulkanMemoryModelDeviceScope = false,
244
.vulkanMemoryModelAvailabilityVisibilityChains = false,
245
.shaderOutputViewportIndex = false,
246
.shaderOutputLayer = false,
247
.subgroupBroadcastDynamicId = false,
250
.robustImageAccess = false,
251
.inlineUniformBlock = false,
252
.descriptorBindingInlineUniformBlockUpdateAfterBind = false,
253
.pipelineCreationCacheControl = false,
255
.shaderDemoteToHelperInvocation = false,
256
.shaderTerminateInvocation = false,
257
.subgroupSizeControl = false,
258
.computeFullSubgroups = false,
259
.synchronization2 = true,
260
.textureCompressionASTC_HDR = false,
261
.shaderZeroInitializeWorkgroupMemory = false,
262
.dynamicRendering = false,
263
.shaderIntegerDotProduct = false,
264
.maintenance4 = false,
266
/* VK_EXT_index_type_uint8 */
267
.indexTypeUint8 = true,
269
/* VK_EXT_vertex_attribute_divisor */
270
.vertexAttributeInstanceRateDivisor = true,
271
.vertexAttributeInstanceRateZeroDivisor = true,
273
/* VK_EXT_depth_clip_enable */
274
.depthClipEnable = true,
276
/* VK_EXT_4444_formats */
277
.formatA4R4G4B4 = true,
278
.formatA4B4G4R4 = true,
280
/* VK_EXT_custom_border_color */
281
.customBorderColors = true,
282
.customBorderColorWithoutFormat = true,
165
286
VkResult panvk_physical_device_try_create(struct vk_instance *vk_instance,
166
287
struct _drmDevice *drm_device,
167
288
struct vk_physical_device **out);
288
409
drmFreeVersion(version);
290
411
if (instance->debug_flags & PANVK_DEBUG_STARTUP)
291
panvk_logi("Found compatible device '%s'.", path);
412
vk_logi(VK_LOG_NO_OBJS(instance), "Found compatible device '%s'.", path);
293
414
struct vk_device_extension_table supported_extensions;
294
415
panvk_get_device_extensions(device, &supported_extensions);
417
struct vk_features supported_features;
418
panvk_get_features(device, &supported_features);
296
420
struct vk_physical_device_dispatch_table dispatch_table;
297
421
vk_physical_device_dispatch_table_from_entrypoints(
298
422
&dispatch_table, &panvk_physical_device_entrypoints, true);
299
423
vk_physical_device_dispatch_table_from_entrypoints(
300
424
&dispatch_table, &wsi_physical_device_entrypoints, false);
302
result = vk_physical_device_init(&device->vk, &instance->vk,
303
&supported_extensions, &dispatch_table);
427
vk_physical_device_init(&device->vk, &instance->vk, &supported_extensions,
428
&supported_features, &dispatch_table);
305
430
if (result != VK_SUCCESS) {
306
431
vk_error(instance, result);
409
panvk_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
410
VkPhysicalDeviceFeatures2 *pFeatures)
412
struct vk_features features = {
414
.robustBufferAccess = true,
415
.fullDrawIndexUint32 = true,
416
.independentBlend = true,
420
.textureCompressionETC2 = true,
421
.textureCompressionASTC_LDR = true,
422
.shaderUniformBufferArrayDynamicIndexing = true,
423
.shaderSampledImageArrayDynamicIndexing = true,
424
.shaderStorageBufferArrayDynamicIndexing = true,
425
.shaderStorageImageArrayDynamicIndexing = true,
428
.storageBuffer16BitAccess = false,
429
.uniformAndStorageBuffer16BitAccess = false,
430
.storagePushConstant16 = false,
431
.storageInputOutput16 = false,
433
.multiviewGeometryShader = false,
434
.multiviewTessellationShader = false,
435
.variablePointersStorageBuffer = true,
436
.variablePointers = true,
437
.protectedMemory = false,
438
.samplerYcbcrConversion = false,
439
.shaderDrawParameters = false,
442
.samplerMirrorClampToEdge = false,
443
.drawIndirectCount = false,
444
.storageBuffer8BitAccess = false,
445
.uniformAndStorageBuffer8BitAccess = false,
446
.storagePushConstant8 = false,
447
.shaderBufferInt64Atomics = false,
448
.shaderSharedInt64Atomics = false,
449
.shaderFloat16 = false,
452
.descriptorIndexing = false,
453
.shaderInputAttachmentArrayDynamicIndexing = false,
454
.shaderUniformTexelBufferArrayDynamicIndexing = false,
455
.shaderStorageTexelBufferArrayDynamicIndexing = false,
456
.shaderUniformBufferArrayNonUniformIndexing = false,
457
.shaderSampledImageArrayNonUniformIndexing = false,
458
.shaderStorageBufferArrayNonUniformIndexing = false,
459
.shaderStorageImageArrayNonUniformIndexing = false,
460
.shaderInputAttachmentArrayNonUniformIndexing = false,
461
.shaderUniformTexelBufferArrayNonUniformIndexing = false,
462
.shaderStorageTexelBufferArrayNonUniformIndexing = false,
463
.descriptorBindingUniformBufferUpdateAfterBind = false,
464
.descriptorBindingSampledImageUpdateAfterBind = false,
465
.descriptorBindingStorageImageUpdateAfterBind = false,
466
.descriptorBindingStorageBufferUpdateAfterBind = false,
467
.descriptorBindingUniformTexelBufferUpdateAfterBind = false,
468
.descriptorBindingStorageTexelBufferUpdateAfterBind = false,
469
.descriptorBindingUpdateUnusedWhilePending = false,
470
.descriptorBindingPartiallyBound = false,
471
.descriptorBindingVariableDescriptorCount = false,
472
.runtimeDescriptorArray = false,
474
.samplerFilterMinmax = false,
475
.scalarBlockLayout = false,
476
.imagelessFramebuffer = false,
477
.uniformBufferStandardLayout = false,
478
.shaderSubgroupExtendedTypes = false,
479
.separateDepthStencilLayouts = false,
480
.hostQueryReset = false,
481
.timelineSemaphore = false,
482
.bufferDeviceAddress = false,
483
.bufferDeviceAddressCaptureReplay = false,
484
.bufferDeviceAddressMultiDevice = false,
485
.vulkanMemoryModel = false,
486
.vulkanMemoryModelDeviceScope = false,
487
.vulkanMemoryModelAvailabilityVisibilityChains = false,
488
.shaderOutputViewportIndex = false,
489
.shaderOutputLayer = false,
490
.subgroupBroadcastDynamicId = false,
493
.robustImageAccess = false,
494
.inlineUniformBlock = false,
495
.descriptorBindingInlineUniformBlockUpdateAfterBind = false,
496
.pipelineCreationCacheControl = false,
498
.shaderDemoteToHelperInvocation = false,
499
.shaderTerminateInvocation = false,
500
.subgroupSizeControl = false,
501
.computeFullSubgroups = false,
502
.synchronization2 = true,
503
.textureCompressionASTC_HDR = false,
504
.shaderZeroInitializeWorkgroupMemory = false,
505
.dynamicRendering = false,
506
.shaderIntegerDotProduct = false,
507
.maintenance4 = false,
509
/* VK_EXT_index_type_uint8 */
510
.indexTypeUint8 = true,
512
/* VK_EXT_vertex_attribute_divisor */
513
.vertexAttributeInstanceRateDivisor = true,
514
.vertexAttributeInstanceRateZeroDivisor = true,
516
/* VK_EXT_depth_clip_enable */
517
.depthClipEnable = true,
519
/* VK_EXT_4444_formats */
520
.formatA4R4G4B4 = true,
521
.formatA4B4G4R4 = true,
523
/* VK_EXT_custom_border_color */
524
.customBorderColors = true,
525
.customBorderColorWithoutFormat = true,
528
vk_get_physical_device_features(pFeatures, &features);
532
532
panvk_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
533
533
VkPhysicalDeviceProperties2 *pProperties)