.specVersion = 5,
},
#endif
+ {
+ .extensionName = VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,
+ .specVersion = 1,
+ },
};
static const VkExtensionProperties device_extensions[] = {
pdevice->compiler->scalar_stage[MESA_SHADER_GEOMETRY];
}
+void anv_GetPhysicalDeviceFeatures2KHR(
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures2KHR* pFeatures)
+{
+ anv_GetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features);
+
+ for (struct anv_common *c = pFeatures->pNext; c != NULL; c = c->pNext) {
+ switch (c->sType) {
+ default:
+ anv_debug_ignored_stype(c->sType);
+ break;
+ }
+ }
+}
+
void anv_GetPhysicalDeviceProperties(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties* pProperties)
memcpy(pProperties->pipelineCacheUUID, pdevice->uuid, VK_UUID_SIZE);
}
+void anv_GetPhysicalDeviceProperties2KHR(
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceProperties2KHR* pProperties)
+{
+ anv_GetPhysicalDeviceProperties(physicalDevice, &pProperties->properties);
+
+ for (struct anv_common *c = pProperties->pNext; c != NULL; c = c->pNext) {
+ switch (c->sType) {
+ default:
+ anv_debug_ignored_stype(c->sType);
+ break;
+ }
+ }
+}
+
static void
anv_get_queue_family_properties(struct anv_physical_device *phys_dev,
VkQueueFamilyProperties *props)
anv_get_queue_family_properties(phys_dev, pQueueFamilyProperties);
}
+void anv_GetPhysicalDeviceQueueFamilyProperties2KHR(
+ VkPhysicalDevice physicalDevice,
+ uint32_t* pQueueFamilyPropertyCount,
+ VkQueueFamilyProperties2KHR* pQueueFamilyProperties)
+{
+
+ ANV_FROM_HANDLE(anv_physical_device, phys_dev, physicalDevice);
+
+ if (pQueueFamilyProperties == NULL) {
+ *pQueueFamilyPropertyCount = 1;
+ return;
+ }
+
+ /* The spec implicitly allows the incoming count to be 0. From the Vulkan
+ * 1.0.38 spec, Section 4.1 Physical Devices:
+ *
+ * If the value referenced by pQueueFamilyPropertyCount is not 0 [then
+ * do stuff].
+ */
+ if (*pQueueFamilyPropertyCount == 0)
+ return;
+
+ /* We support exactly one queue family. So need to traverse only the first
+ * array element's pNext chain.
+ */
+ *pQueueFamilyPropertyCount = 1;
+ anv_get_queue_family_properties(phys_dev,
+ &pQueueFamilyProperties->queueFamilyProperties);
+
+ for (struct anv_common *c = pQueueFamilyProperties->pNext;
+ c != NULL; c = c->pNext) {
+ switch (c->sType) {
+ default:
+ anv_debug_ignored_stype(c->sType);
+ break;
+ }
+ }
+}
+
void anv_GetPhysicalDeviceMemoryProperties(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceMemoryProperties* pMemoryProperties)
};
}
+void anv_GetPhysicalDeviceMemoryProperties2KHR(
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties)
+{
+ anv_GetPhysicalDeviceMemoryProperties(physicalDevice,
+ &pMemoryProperties->memoryProperties);
+
+ for (struct anv_common *c = pMemoryProperties->pNext;
+ c != NULL; c = c->pNext) {
+ switch (c->sType) {
+ default:
+ anv_debug_ignored_stype(c->sType);
+ break;
+ }
+ }
+}
+
PFN_vkVoidFunction anv_GetInstanceProcAddr(
VkInstance instance,
const char* pName)
pFormatProperties);
}
+void anv_GetPhysicalDeviceFormatProperties2KHR(
+ VkPhysicalDevice physicalDevice,
+ VkFormat format,
+ VkFormatProperties2KHR* pFormatProperties)
+{
+ anv_GetPhysicalDeviceFormatProperties(physicalDevice, format,
+ &pFormatProperties->formatProperties);
+
+ for (struct anv_common *c = pFormatProperties->pNext;
+ c != NULL; c = c->pNext) {
+ switch (c->sType) {
+ default:
+ anv_debug_ignored_stype(c->sType);
+ break;
+ }
+ }
+}
+
static VkResult
anv_get_image_format_properties(
struct anv_physical_device *physical_device,
pImageFormatProperties);
}
+VkResult anv_GetPhysicalDeviceImageFormatProperties2KHR(
+ VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
+ VkImageFormatProperties2KHR* pImageFormatProperties)
+{
+ ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice);
+ VkResult result;
+
+ result = anv_get_image_format_properties(physical_device, pImageFormatInfo,
+ &pImageFormatProperties->imageFormatProperties);
+ if (result != VK_SUCCESS)
+ return result;
+
+ for (struct anv_common *c = pImageFormatProperties->pNext;
+ c != NULL; c = c->pNext) {
+ switch (c->sType) {
+ default:
+ anv_debug_ignored_stype(c->sType);
+ break;
+ }
+ }
+
+ return VK_SUCCESS;
+}
+
void anv_GetPhysicalDeviceSparseImageFormatProperties(
VkPhysicalDevice physicalDevice,
VkFormat format,
/* Sparse images are not yet supported. */
*pNumProperties = 0;
}
+
+void anv_GetPhysicalDeviceSparseImageFormatProperties2KHR(
+ VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
+ uint32_t* pPropertyCount,
+ VkSparseImageFormatProperties2KHR* pProperties)
+{
+ /* Sparse images are not yet supported. */
+ *pPropertyCount = 0;
+}
#define anv_debug(format, ...)
#endif
+/**
+ * Warn on ignored extension structs.
+ *
+ * The Vulkan spec requires us to ignore unsupported or unknown structs in
+ * a pNext chain. In debug mode, emitting warnings for ignored structs may
+ * help us discover structs that we should not have ignored.
+ *
+ *
+ * From the Vulkan 1.0.38 spec:
+ *
+ * Any component of the implementation (the loader, any enabled layers,
+ * and drivers) must skip over, without processing (other than reading the
+ * sType and pNext members) any chained structures with sType values not
+ * defined by extensions supported by that component.
+ */
+#define anv_debug_ignored_stype(sType) \
+ anv_debug("debug: %s: ignored VkStructureType %u\n", __func__, (sType))
+
void __anv_finishme(const char *file, int line, const char *format, ...)
anv_printflike(3, 4);
void anv_loge(const char *format, ...) anv_printflike(1, 2);