This just seems cleaner, and we may expand this in future.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
#include "vk_util.h"
#include "util/macros.h"
+#define WSI_CB(x) .x = radv_##x
MAYBE_UNUSED static const struct wsi_callbacks wsi_cbs = {
- .get_phys_device_format_properties = radv_GetPhysicalDeviceFormatProperties,
+ WSI_CB(GetPhysicalDeviceFormatProperties),
};
VkResult
#include "vk_util.h"
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
+#define WSI_CB(x) .x = anv_##x
static const struct wsi_callbacks wsi_cbs = {
- .get_phys_device_format_properties = anv_GetPhysicalDeviceFormatProperties,
+ WSI_CB(GetPhysicalDeviceFormatProperties),
};
#endif
struct wsi_interface * wsi[VK_ICD_WSI_PLATFORM_MAX];
};
+#define WSI_CB(cb) PFN_vk##cb cb
struct wsi_callbacks {
- void (*get_phys_device_format_properties)(VkPhysicalDevice physicalDevice,
- VkFormat format,
- VkFormatProperties *pFormatProperties);
+ WSI_CB(GetPhysicalDeviceFormatProperties);
};
+#undef WSI_CB
#define WSI_DEFINE_NONDISP_HANDLE_CASTS(__wsi_type, __VkType) \
\
/* Don't add formats that aren't renderable. */
VkFormatProperties props;
- display->wsi_wl->cbs->get_phys_device_format_properties(display->wsi_wl->physical_device,
+ display->wsi_wl->cbs->GetPhysicalDeviceFormatProperties(display->wsi_wl->physical_device,
format, &props);
if (!(props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT))
return;